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