From: Michael Brown Date: Thu, 3 Mar 2011 17:13:44 +0000 (+0000) Subject: [settings] Avoid fetch_string_setting_copy() leaving an uninitialised pointer X-Git-Tag: v1.20.1~2281 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09695f7be98ab96204e570f95aeb9192e4c3a9f6;p=thirdparty%2Fipxe.git [settings] Avoid fetch_string_setting_copy() leaving an uninitialised pointer For consistency with other functions in the fetch_setting() family, ensure that fetch_string_setting_copy() always initialises the pointer to the fetched setting even if fetching fails. Signed-off-by: Michael Brown --- diff --git a/src/core/settings.c b/src/core/settings.c index da662e616..1f22ea45f 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -632,6 +632,8 @@ int fetch_string_setting_copy ( struct settings *settings, int len; int check_len = 0; + *data = NULL; + len = fetch_setting_len ( settings, setting ); if ( len < 0 ) return len;