From: Andrei Borzenkov Date: Fri, 19 Jun 2015 15:38:25 +0000 (+0300) Subject: unix/getroot: memory leak X-Git-Tag: 2.02-beta3~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d0ee3d7a1a1381cb75111f2992d5d97b301894f;p=thirdparty%2Fgrub.git unix/getroot: memory leak Found by Coverity scan. CID: 96605 --- diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c index b98b2dfb0..14d483fb1 100644 --- a/grub-core/osdep/unix/getroot.c +++ b/grub-core/osdep/unix/getroot.c @@ -544,6 +544,7 @@ grub_guess_root_devices (const char *dir_in) if (stat (dir, &st) < 0) grub_util_error (_("cannot stat `%s': %s"), dir, strerror (errno)); + free (dir); dev = st.st_dev;