summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2006-06-06 02:47:30 +0300
committerunknown <monty@mysql.com>2006-06-06 02:47:30 +0300
commit2017107969f25998c2e0970b6bbe3749ef9ea244 (patch)
tree95341607866eaeca795c9a1a4c4c0d94df862cfd /sql/ha_berkeley.cc
parent6c3babe52c28d28a92d242307e13723500dce969 (diff)
downloadmariadb-git-2017107969f25998c2e0970b6bbe3749ef9ea244.tar.gz
Fixed some issues found by valgrind
(one testcase, one memory leak and some accesses to not initialized memory) mysql-test/r/events_scheduling.result: Changed event timer to two seconds to not get problems with slow system or when running with valgrind mysql-test/t/events_scheduling.test: Changed event timer to two seconds to not get problems with slow system or when running with valgrind mysql-test/valgrind.supp: Avoid purify warnings from DBUG library (safe to do) sql/ha_berkeley.cc: Fix problem with not freed memory sql/sql_class.cc: Ensure that row_count is initalized (as we otherwise may access it uninitialized) sql/sql_show.cc: c_ptr -> ptr to avoid accessing not initialized memory sql/sql_yacc.yy: Fix to not access not initialized memory sql/table.cc: Fix to not access not initialized memory sql/time.cc: Fix to not access not initialized memory
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 6f5f9f32e76..d8159a81f90 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -361,6 +361,7 @@ static bool berkeley_show_logs(THD *thd, stat_print_fn *stat_print)
init_sql_alloc(&show_logs_root, BDB_LOG_ALLOC_BLOCK_SIZE,
BDB_LOG_ALLOC_BLOCK_SIZE);
*root_ptr= &show_logs_root;
+ all_logs= free_logs= 0;
if ((error= db_env->log_archive(db_env, &all_logs,
DB_ARCH_ABS | DB_ARCH_LOG)) ||
@@ -395,6 +396,10 @@ static bool berkeley_show_logs(THD *thd, stat_print_fn *stat_print)
}
}
err:
+ if (all_logs)
+ free(all_logs);
+ if (free_logs)
+ free(free_logs);
free_root(&show_logs_root,MYF(0));
*root_ptr= old_mem_root;
DBUG_RETURN(error);