From: Christopher R. Hertel (crh) Date: Fri, 14 Feb 2014 17:41:24 +0000 (-0600) Subject: regedit_valuelist.c: Coverity fix; Initialize a variable. X-Git-Tag: tdb-1.2.13~364 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=938bbff1243400401d534174301939fdd2c59cb9;p=thirdparty%2Fsamba.git regedit_valuelist.c: Coverity fix; Initialize a variable. The variable is tested at the end of the function to determine the return value, but is never initialized and there are conditions under which it may be tested before a value is set. This patch initializes to NULL, which means that WERR_NOMEM will be returned if the registry lookups fail. CID: 1168007 Signed-off-by: Christopher R. Hertel (crh) Reviewed-by: Jeremy Allison --- diff --git a/source3/utils/regedit_valuelist.c b/source3/utils/regedit_valuelist.c index 4d21be54168..b135159ed92 100644 --- a/source3/utils/regedit_valuelist.c +++ b/source3/utils/regedit_valuelist.c @@ -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 */