summaryrefslogtreecommitdiff
path: root/mysys/my_alloc.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-01-13 03:02:49 +0200
committerunknown <monty@mysql.com>2005-01-13 03:02:49 +0200
commit90b9065dce225bdc3844aaa1b15fe110e1eaa2fa (patch)
treea3c2244375497d36d806624e45257ec4d81d9438 /mysys/my_alloc.c
parenta21bb5754663a80115fd2e4d0284c356a8e44f09 (diff)
downloadmariadb-git-90b9065dce225bdc3844aaa1b15fe110e1eaa2fa.tar.gz
Fix accesses to uninitialized memory (found by valgrind)
mysys/my_alloc.c: Added comment for free_root sql/filesort.cc: Removed valgrind warning sql/sql_select.cc: Remove not needed my_casedn_str() for internal files (Old code actually didn't do any god as it was accessing not used memory) sql/sql_view.cc: Removed access to uninitialized memory sql/table.cc: Cleanup of error handling
Diffstat (limited to 'mysys/my_alloc.c')
-rw-r--r--mysys/my_alloc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index d8c19d86e5c..c14b2899b4b 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -245,6 +245,19 @@ static inline void mark_blocks_free(MEM_ROOT* root)
/*
Deallocate everything used by alloc_root or just move
used blocks to free list if called with MY_USED_TO_FREE
+
+ SYNOPSIS
+ free_root()
+ root Memory root
+ MyFlags Flags for what should be freed:
+
+ MY_MARK_BLOCKS_FREED Don't free blocks, just mark them free
+ MY_KEEP_PREALLOC If this is not set, then free also the
+ preallocated block
+
+ NOTES
+ One can call this function either with root block initialised with
+ init_alloc_root() or with a bzero()-ed block.
*/
void free_root(MEM_ROOT *root, myf MyFlags)