15a2072
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
15a2072
From: Will Thompson <wjt@endlessm.com>
15a2072
Date: Thu, 12 Jul 2018 10:14:43 +0100
15a2072
Subject: [PATCH] blscfg: remove NULL guards around grub_free()
15a2072
15a2072
The internal implementation of grub_free() is NULL-safe. In emu builds,
15a2072
it just delegates to the host's free(), which is specified by ANSI C to
15a2072
be NULL-safe.
15a2072
15a2072
Signed-off-by: Will Thompson <wjt@endlessm.com>
15a2072
---
15a2072
 grub-core/commands/blscfg.c | 23 ++++++-----------------
15a2072
 1 file changed, 6 insertions(+), 17 deletions(-)
15a2072
15a2072
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
15a2072
index 9c928dda470..bd78559ef68 100644
15a2072
--- a/grub-core/commands/blscfg.c
15a2072
+++ b/grub-core/commands/blscfg.c
15a2072
@@ -600,23 +600,12 @@ static void create_entry (struct bls_entry *entry, const char *cfgfile)
15a2072
   grub_normal_add_menu_entry (argc, argv, classes, id, users, hotkey, NULL, src, 0);
15a2072
 
15a2072
 finish:
15a2072
-  if (initrd)
15a2072
-    grub_free (initrd);
15a2072
-
15a2072
-  if (initrds)
15a2072
-    grub_free (initrds);
15a2072
-
15a2072
-  if (classes)
15a2072
-    grub_free (classes);
15a2072
-
15a2072
-  if (args)
15a2072
-    grub_free (args);
15a2072
-
15a2072
-  if (argv)
15a2072
-    grub_free (argv);
15a2072
-
15a2072
-  if (src)
15a2072
-    grub_free (src);
15a2072
+  grub_free (initrd);
15a2072
+  grub_free (initrds);
15a2072
+  grub_free (classes);
15a2072
+  grub_free (args);
15a2072
+  grub_free (argv);
15a2072
+  grub_free (src);
15a2072
 }
15a2072
 
15a2072
 struct find_entry_info {