From: Lennart Poettering Date: Wed, 20 Jun 2018 21:20:47 +0000 (+0200) Subject: sd-boot: properly free all config entry fields X-Git-Tag: v240~522^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42cf81c26fad4b3ef4611d2887230707835c4c70;p=thirdparty%2Fsystemd.git sd-boot: properly free all config entry fields --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 82b89397405..cb041363cdc 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -851,11 +851,17 @@ static VOID config_add_entry(Config *config, ConfigEntry *entry) { } static VOID config_entry_free(ConfigEntry *entry) { + if (!entry) + return; + + FreePool(entry->id); FreePool(entry->title_show); FreePool(entry->title); + FreePool(entry->version); FreePool(entry->machine_id); FreePool(entry->loader); FreePool(entry->options); + FreePool(entry); } static BOOLEAN is_digit(CHAR16 c) { @@ -1151,7 +1157,6 @@ static VOID config_entry_add_from_file( if (entry->type == LOADER_UNDEFINED) { config_entry_free(entry); - FreePool(entry); return; }