qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>, Greg Kurz <groug@kaod.org>
Subject: [Qemu-devel] [PULL 2/6] 9pfs: fix fd leak in local_opendir()
Date: Mon,  6 Mar 2017 18:54:06 +0100	[thread overview]
Message-ID: <1488822850-23070-3-git-send-email-groug@kaod.org> (raw)
In-Reply-To: <1488822850-23070-1-git-send-email-groug@kaod.org>

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>
---
 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 5db7104334d6..09f6a46d61b8 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;
-- 
2.7.4

  parent reply	other threads:[~2017-03-06 17:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 17:54 [Qemu-devel] [PULL 0/6] 9pfs fixes for 2.9 2017-03-06 Greg Kurz
2017-03-06 17:54 ` [Qemu-devel] [PULL 1/6] 9pfs: fix bogus fd check in local_remove() Greg Kurz
2017-03-06 17:54 ` Greg Kurz [this message]
2017-03-06 17:54 ` [Qemu-devel] [PULL 3/6] 9pfs: fail local_statfs() earlier Greg Kurz
2017-03-06 17:54 ` [Qemu-devel] [PULL 4/6] 9pfs: don't use AT_EMPTY_PATH in local_set_cred_passthrough() Greg Kurz
2017-03-06 17:54 ` [Qemu-devel] [PULL 5/6] 9pfs: fix O_PATH build break with older glibc versions Greg Kurz
2017-03-06 17:54 ` [Qemu-devel] [PULL 6/6] 9pfs: fix vulnerability in openat_dir() and local_unlinkat_common() Greg Kurz
2017-03-06 21:16 ` [Qemu-devel] [PULL 0/6] 9pfs fixes for 2.9 2017-03-06 Mark Cave-Ayland
2017-03-07  9:57 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488822850-23070-3-git-send-email-groug@kaod.org \
    --to=groug@kaod.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).