Browse Source

[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>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
09695f7be9
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/core/settings.c

+ 2
- 0
src/core/settings.c View File

632
 	int len;
632
 	int len;
633
 	int check_len = 0;
633
 	int check_len = 0;
634
 
634
 
635
+	*data = NULL;
636
+
635
 	len = fetch_setting_len ( settings, setting );
637
 	len = fetch_setting_len ( settings, setting );
636
 	if ( len < 0 )
638
 	if ( len < 0 )
637
 		return len;
639
 		return len;

Loading…
Cancel
Save