qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] vmdk: fix vmdk_parse_extents() extent_file leaks
Date: Thu,  4 Sep 2014 21:04:42 +0100	[thread overview]
Message-ID: <1409861083-9634-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1409861083-9634-1-git-send-email-stefanha@redhat.com>

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/vmdk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/vmdk.c b/block/vmdk.c
index 07cb62c..9bf28f3 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -834,6 +834,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
             ret = vmdk_add_extent(bs, extent_file, true, sectors,
                             0, 0, 0, 0, 0, &extent, errp);
             if (ret < 0) {
+                bdrv_unref(extent_file);
                 return ret;
             }
             extent->flat_start_offset = flat_offset << 9;
@@ -853,6 +854,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
             extent = &s->extents[s->num_extents - 1];
         } else {
             error_setg(errp, "Unsupported extent type '%s'", type);
+            bdrv_unref(extent_file);
             return -ENOTSUP;
         }
         extent->type = g_strdup(type);
-- 
1.9.3

  reply	other threads:[~2014-09-04 20:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 20:04 [Qemu-devel] [PATCH 0/2] vmdk: fix leaks in vmdk_parse_extents() Stefan Hajnoczi
2014-09-04 20:04 ` Stefan Hajnoczi [this message]
2014-09-04 20:11   ` [Qemu-devel] [PATCH 1/2] vmdk: fix vmdk_parse_extents() extent_file leaks Max Reitz
2014-09-05  4:52   ` Fam Zheng
2014-09-04 20:04 ` [Qemu-devel] [PATCH 2/2] vmdk: fix buf leak in vmdk_parse_extents() Stefan Hajnoczi
2014-09-04 20:13   ` Max Reitz
2014-09-05  4:52   ` Fam Zheng
2014-09-05  9:44 ` [Qemu-devel] [PATCH 0/2] vmdk: fix leaks " Stefan Hajnoczi

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=1409861083-9634-2-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --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).