0084-gfxmenu-gui_list-Remove-code-that-coverity-is-flaggi.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 4a1aa5917595650efbd46b581368c470ebee42ab Mon Sep 17 00:00:00 2001
  2. From: Darren Kenny <darren.kenny@oracle.com>
  3. Date: Mon, 7 Dec 2020 14:44:47 +0000
  4. Subject: [PATCH] gfxmenu/gui_list: Remove code that coverity is flagging as
  5. dead
  6. The test of value for NULL before calling grub_strdup() is not required,
  7. since the if condition prior to this has already tested for value being
  8. NULL and cannot reach this code if it is.
  9. Fixes: CID 73659
  10. Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
  11. Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
  12. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
  13. ---
  14. grub-core/gfxmenu/gui_list.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/grub-core/gfxmenu/gui_list.c b/grub-core/gfxmenu/gui_list.c
  17. index 01477cd..df334a6 100644
  18. --- a/grub-core/gfxmenu/gui_list.c
  19. +++ b/grub-core/gfxmenu/gui_list.c
  20. @@ -771,7 +771,7 @@ list_set_property (void *vself, const char *name, const char *value)
  21. {
  22. self->need_to_recreate_boxes = 1;
  23. grub_free (self->selected_item_box_pattern);
  24. - self->selected_item_box_pattern = value ? grub_strdup (value) : 0;
  25. + self->selected_item_box_pattern = grub_strdup (value);
  26. self->selected_item_box_pattern_inherit = 0;
  27. }
  28. }
  29. --
  30. 2.14.2