Author: jra Date: 2006-03-14 20:37:24 +0000 (Tue, 14 Mar 2006) New Revision: 14397
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14397 Log: Fix deadcode in coverity error #1. Jeremy. Modified: branches/SAMBA_3_0/source/lib/debug.c Changeset: Modified: branches/SAMBA_3_0/source/lib/debug.c =================================================================== --- branches/SAMBA_3_0/source/lib/debug.c 2006-03-14 20:32:31 UTC (rev 14396) +++ branches/SAMBA_3_0/source/lib/debug.c 2006-03-14 20:37:24 UTC (rev 14397) @@ -191,12 +191,14 @@ 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 @@ 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;