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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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