summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-14 20:37:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:28 -0500
commit85d3b74844453bcfa0bb46f1c28aab2ae40d0d39 (patch)
treef2e994a7f9450b5384313923044ef797d8d8e5b0
parentbe2bc3147c562acf6472bd6f3b4eadb3d9115ba3 (diff)
downloadsamba-85d3b74844453bcfa0bb46f1c28aab2ae40d0d39.tar.gz
samba-85d3b74844453bcfa0bb46f1c28aab2ae40d0d39.tar.bz2
samba-85d3b74844453bcfa0bb46f1c28aab2ae40d0d39.zip
r14397: Fix deadcode in coverity error #1.
Jeremy. (This used to be commit 4a4953c4d27cd1e925c9afe24fa49b015ce033ec)
-rw-r--r--source3/lib/debug.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index f3676070dc..29d879adbc 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -191,12 +191,14 @@ static char *debug_list_class_names_and_levels(void)
char *b;
BOOL err = False;
- if (DEBUGLEVEL_CLASS == &debug_all_class_hack)
+ if (DEBUGLEVEL_CLASS == &debug_all_class_hack) {
return NULL;
+ }
list = SMB_CALLOC_ARRAY(char *, debug_num_classes + 1);
- if (!list)
+ if (!list) {
return NULL;
+ }
/* prepare strings */
for (i = 0, dim = 0; i < debug_num_classes; i++) {
@@ -227,13 +229,12 @@ static char *debug_list_class_names_and_levels(void)
done:
/* free strings list */
- for (i = 0; i < debug_num_classes; i++)
- if (list[i]) free(list[i]);
- free(list);
+ for (i = 0; i < debug_num_classes; i++) {
+ SAFE_FREE(list[i]);
+ }
+ SAFE_FREE(list);
if (err) {
- if (buf)
- free(buf);
return NULL;
} else {
return buf;