From: Alec Brown Date: Sat, 20 Jan 2024 02:52:50 +0000 (+0000) Subject: osdep/unix/getroot: Clean up redundant code X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db0d19dc5f85a6404f7e6a2d52bbeec0ea20579d;p=thirdparty%2Fgrub.git osdep/unix/getroot: Clean up redundant code In grub-core/osdep/unix/getroot.c, Coverity spotted redundant code where the double pointer os_dev was being set to 0 and then being overwritten later without being used. Since this is unnecessary, we can remove the code that sets os_dev to 0. Fixes: CID 428875 Signed-off-by: Alec Brown Reviewed-by: Daniel Kiper --- diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c index ee11b02fb..c7aa202ab 100644 --- a/grub-core/osdep/unix/getroot.c +++ b/grub-core/osdep/unix/getroot.c @@ -540,7 +540,6 @@ grub_guess_root_devices (const char *dir_in) for (cur = os_dev; *cur; cur++) free (*cur); free (os_dev); - os_dev = 0; } if (stat (dir, &st) < 0)