Skip to content
Snippets Groups Projects
Commit fed414df authored by Fam Zheng's avatar Fam Zheng Committed by Kevin Wolf
Browse files

file-posix: Don't leak fd in hdev_get_max_segments


This fixes a leaked fd introduced in commit 9103f1ce.

Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 37a9051c
No related branches found
No related tags found
No related merge requests found
......@@ -703,6 +703,9 @@ static int hdev_get_max_segments(const struct stat *st)
}
out:
if (fd != -1) {
close(fd);
}
g_free(sysfspath);
return ret;
#else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment