From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnobf-0005hG-O7 for qemu-devel@nongnu.org; Tue, 14 Mar 2017 11:43:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnobf-0004tR-2P for qemu-devel@nongnu.org; Tue, 14 Mar 2017 11:43:27 -0400 From: Fam Zheng Date: Tue, 14 Mar 2017 23:43:15 +0800 Message-Id: <20170314154315.17869-1-famz@redhat.com> Subject: [Qemu-devel] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Kevin Wolf , Max Reitz , qemu-block@nongnu.org Signed-off-by: Fam Zheng --- block/file-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/file-posix.c b/block/file-posix.c index c4c0663..e6170f4 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -703,6 +703,7 @@ static int hdev_get_max_segments(const struct stat *st) } out: + close(fd); g_free(sysfspath); return ret; #else -- 2.9.3