From: Greg Kurz Date: Mon, 6 Mar 2017 16:34:01 +0000 (+0100) Subject: 9pfs: fix fd leak in local_opendir() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=faab207f115cf9738f110cb088ab35a4b7aef73a;p=qemu.git 9pfs: fix fd leak in local_opendir() Coverity issue CID1371731 Signed-off-by: Greg Kurz Reviewed-by: Daniel P. Berrange Reviewed-by: Philippe Mathieu-Daudé --- 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;