15a2072
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
15a2072
From: Will Thompson <wjt@endlessm.com>
15a2072
Date: Thu, 12 Jul 2018 10:59:10 +0100
15a2072
Subject: [PATCH] blscfg: don't leak bls_entry.filename
15a2072
15a2072
Zeroing the bls_entry struct before calling grub_free() on one of its
15a2072
fields is not going to work too well.
15a2072
15a2072
Signed-off-by: Will Thompson <wjt@endlessm.com>
15a2072
---
15a2072
 grub-core/commands/blscfg.c | 2 +-
15a2072
 1 file changed, 1 insertion(+), 1 deletion(-)
15a2072
15a2072
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
15a2072
index a45f40fe67e..11a356de81a 100644
15a2072
--- a/grub-core/commands/blscfg.c
15a2072
+++ b/grub-core/commands/blscfg.c
15a2072
@@ -166,8 +166,8 @@ static void bls_free_entry(struct bls_entry *entry)
15a2072
     }
15a2072
 
15a2072
   grub_free (entry->keyvals);
15a2072
-  grub_memset (entry, 0, sizeof (*entry));
15a2072
   grub_free (entry->filename);
15a2072
+  grub_memset (entry, 0, sizeof (*entry));
15a2072
   grub_free (entry);
15a2072
 }
15a2072