mirror of
http://cgit.git.savannah.gnu.org/git/grub.git
synced 2026-04-28 06:33:17 +00:00
linux/getroot: fix descriptor leak.
Found by: Coverity scan.
This commit is contained in:
@@ -360,8 +360,10 @@ get_btrfs_fs_prefix (const char *mount_path)
|
||||
ret[1+namelen] = '\0';
|
||||
}
|
||||
if (!ret)
|
||||
return xstrdup ("/");
|
||||
ret = xstrdup ("/");
|
||||
close (fd);
|
||||
return ret;
|
||||
|
||||
fail:
|
||||
free (ret);
|
||||
close (fd);
|
||||
|
||||
Reference in New Issue
Block a user