Skip to content

Commit

Permalink
[settings] Avoid fetch_string_setting_copy() leaving an uninitialised…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
mcb30 committed Mar 3, 2011
1 parent e809985 commit 09695f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/settings.c
Expand Up @@ -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;
Expand Down

0 comments on commit 09695f7

Please sign in to comment.