]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
regedit_valuelist.c: Coverity fix; Initialize a variable.
authorChristopher R. Hertel (crh) <crh@samba.org>
Fri, 14 Feb 2014 17:41:24 +0000 (11:41 -0600)
committerJeremy Allison <jra@samba.org>
Fri, 14 Feb 2014 18:47:22 +0000 (10:47 -0800)
The <tmp> variable is tested at the end of the function to determine the
return value, but <tmp> is never initialized and there are conditions
under which it may be tested before a value is set.

This patch initializes <tmp> to NULL, which means that WERR_NOMEM will
be returned if the registry lookups fail.

CID:  1168007

Signed-off-by: Christopher R. Hertel (crh) <crh@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/regedit_valuelist.c

index 4d21be54168ff82121ecaf9dfd5f0ad4b1f820a5..b135159ed9289d2690b3166627390c1e82f5f3a4 100644 (file)
@@ -169,7 +169,7 @@ static bool string_is_printable(const char *s)
 
 static WERROR append_data_summary(struct value_item *vitem)
 {
-       char *tmp;
+       char *tmp = NULL;
 
 /* This is adapted from print_registry_value() in net_registry_util.c */