nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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