Skip to contentSkip to conversation

x86: fix BAD_FREE in get_efi_runtime_map()

PATCH Applied Pingfan Liu 2 participants 2 messages Oct 22, 2018 – Oct 29, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fix BAD_FREE in get_efi_runtime_map()

If the err_out label is reached, address of a stack variable is passed to free(). Fix it.

---
 kexec/arch/i386/x86-linux-setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kexec/arch/i386/x86-linux-setup.c +2 -2
index 6c7d260..6cda12c 100644
@@ -595,8 +595,8 @@ static int get_efi_runtime_map(struct efi_mem_descriptor **map)
 	closedir(dirp);
 	return nr_maps;
 err_out:
-	if (map)
-		free(map);
+	if (*map)
+		free(*map);
 	closedir(dirp);
 	return 0;
 }
Signature · 7 lines
2.7.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec