aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2017-03-06 17:34:01 +0100
committerGreg Kurz <groug@kaod.org>2017-03-06 17:34:01 +0100
commitfaab207f115cf9738f110cb088ab35a4b7aef73a (patch)
treed4ff2ee02e8b62d6d6bcb5d5c5c1f4c0081062e9 /hw
parentb7361d46e75f12d8d943ca8d33ef82cafce39920 (diff)
9pfs: fix fd leak in local_opendir()
Coverity issue CID1371731 Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/9pfs/9p-local.c1
1 files changed, 1 insertions, 0 deletions
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;