linux/getroot: fix descriptor leak.
Found by: Coverity scan.
This commit is contained in:
parent
11eed6abce
commit
6704abade6
1 changed files with 3 additions and 1 deletions
|
@ -360,8 +360,10 @@ get_btrfs_fs_prefix (const char *mount_path)
|
||||||
ret[1+namelen] = '\0';
|
ret[1+namelen] = '\0';
|
||||||
}
|
}
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return xstrdup ("/");
|
ret = xstrdup ("/");
|
||||||
|
close (fd);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
free (ret);
|
free (ret);
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
Loading…
Reference in a new issue