From faab207f115cf9738f110cb088ab35a4b7aef73a Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Mon, 6 Mar 2017 17:34:01 +0100 Subject: 9pfs: fix fd leak in local_opendir() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coverity issue CID1371731 Signed-off-by: Greg Kurz Reviewed-by: Daniel P. Berrange Reviewed-by: Philippe Mathieu-Daudé --- hw/9pfs/9p-local.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 5db7104334..09f6a46d61 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -435,6 +435,7 @@ static int local_opendir(FsContext *ctx, stream = fdopendir(dirfd); if (!stream) { + close(dirfd); return -1; } fs->dir.stream = stream; -- cgit v1.2.1