dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0383-gfxmenu-gui_list-Remove-code-that-coverity-is-flaggi.patch

b1bcb2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b1bcb2
From: Darren Kenny <darren.kenny@oracle.com>
b1bcb2
Date: Mon, 7 Dec 2020 14:44:47 +0000
b1bcb2
Subject: [PATCH] gfxmenu/gui_list: Remove code that coverity is flagging as
b1bcb2
 dead
b1bcb2
b1bcb2
The test of value for NULL before calling grub_strdup() is not required,
b1bcb2
since the if condition prior to this has already tested for value being
b1bcb2
NULL and cannot reach this code if it is.
b1bcb2
b1bcb2
Fixes: CID 73659
b1bcb2
b1bcb2
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
b1bcb2
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
b1bcb2
---
b1bcb2
 grub-core/gfxmenu/gui_list.c | 2 +-
b1bcb2
 1 file changed, 1 insertion(+), 1 deletion(-)
b1bcb2
b1bcb2
diff --git a/grub-core/gfxmenu/gui_list.c b/grub-core/gfxmenu/gui_list.c
b1bcb2
index 5d26811f9d2..2a52a529247 100644
b1bcb2
--- a/grub-core/gfxmenu/gui_list.c
b1bcb2
+++ b/grub-core/gfxmenu/gui_list.c
b1bcb2
@@ -768,7 +768,7 @@ list_set_property (void *vself, const char *name, const char *value)
b1bcb2
         {
b1bcb2
           self->need_to_recreate_boxes = 1;
b1bcb2
           grub_free (self->selected_item_box_pattern);
b1bcb2
-          self->selected_item_box_pattern = value ? grub_strdup (value) : 0;
b1bcb2
+          self->selected_item_box_pattern = grub_strdup (value);
b1bcb2
           self->selected_item_box_pattern_inherit = 0;
b1bcb2
         }
b1bcb2
     }