mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
linux/getroot: fix descriptor leak.
Found by: Coverity scan.
This commit is contained in:
1 parent
11eed6abce
commit
6704abade6
1 file changed
+3
-1
@@ -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