dcavalca / rpms / grub2

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