dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0355-kern-efi-Fix-memory-leak-on-failure.patch

b1bcb2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b1bcb2
From: Darren Kenny <darren.kenny@oracle.com>
b1bcb2
Date: Thu, 5 Nov 2020 10:15:25 +0000
b1bcb2
Subject: [PATCH] kern/efi: Fix memory leak on failure
b1bcb2
b1bcb2
Free the memory allocated to name before returning on failure.
b1bcb2
b1bcb2
Fixes: CID 296222
b1bcb2
b1bcb2
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
b1bcb2
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
b1bcb2
---
b1bcb2
 grub-core/kern/efi/efi.c | 1 +
b1bcb2
 1 file changed, 1 insertion(+)
b1bcb2
b1bcb2
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
b1bcb2
index 6c4099a685d..fce4ca05c65 100644
b1bcb2
--- a/grub-core/kern/efi/efi.c
b1bcb2
+++ b/grub-core/kern/efi/efi.c
b1bcb2
@@ -381,6 +381,7 @@ grub_efi_get_filename (grub_efi_device_path_t *dp0)
b1bcb2
 	    {
b1bcb2
 	      grub_error (GRUB_ERR_OUT_OF_RANGE,
b1bcb2
 			  "malformed EFI Device Path node has length=%d", len);
b1bcb2
+	      grub_free (name);
b1bcb2
 	      return NULL;
b1bcb2
 	    }
b1bcb2