summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-03-04 12:23:16 +1100
committerAndrew Tridgell <tridge@samba.org>2011-03-04 03:09:52 +0100
commit3560db3da3e3b25c98287701dbc6478358457495 (patch)
tree555d540a4f88ba8475e7a2c4b07bde8399d779fd
parente63f0dfba173e9553ec2bb009b58113b4270f437 (diff)
downloadsamba-3560db3da3e3b25c98287701dbc6478358457495.tar.gz
samba-3560db3da3e3b25c98287701dbc6478358457495.tar.bz2
samba-3560db3da3e3b25c98287701dbc6478358457495.zip
debug: fixed a valgrind error
Thanks to Volker for spotting this one! Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Fri Mar 4 03:09:52 CET 2011 on sn-devel-104
-rw-r--r--lib/util/debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index d2f3d922ae..c7ba19e3cc 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -255,6 +255,7 @@ int debug_add_class(const char *classname)
int ndx;
int *new_class_list;
char **new_name_list;
+ int default_level;
if (!classname)
return -1;
@@ -274,12 +275,14 @@ int debug_add_class(const char *classname)
new_class_list = DEBUGLEVEL_CLASS;
}
+ default_level = DEBUGLEVEL_CLASS[DBGC_ALL];
+
new_class_list = talloc_realloc(NULL, new_class_list, int, ndx + 1);
if (!new_class_list)
return -1;
DEBUGLEVEL_CLASS = new_class_list;
- DEBUGLEVEL_CLASS[ndx] = DEBUGLEVEL_CLASS[DBGC_ALL];
+ DEBUGLEVEL_CLASS[ndx] = default_level;
new_name_list = talloc_realloc(NULL, classname_table, char *, ndx + 1);
if (!new_name_list)