david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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 <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2011-03-03 17:13:44 +00:00
parent e809985ca9
commit 09695f7be9
1 changed files with 2 additions and 0 deletions

View File

@ -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;