From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PULL 2/3] qcow2-bitmap: fix bitmap_free
Date: Tue, 25 Jul 2017 17:12:32 +0200 [thread overview]
Message-ID: <20170725151233.26077-3-mreitz@redhat.com> (raw)
In-Reply-To: <20170725151233.26077-1-mreitz@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fix possible crash on error path in
qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in
88ddffae8fc the bug was introduced later in commit 469c71edc72 (when
qcow2_remove_persistent_dirty_bitmap was added).
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20170714123341.373857-1-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/qcow2-bitmap.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 3e8735a..e8d3bdb 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -487,6 +487,10 @@ static inline void bitmap_directory_to_be(uint8_t *dir, size_t size)
static void bitmap_free(Qcow2Bitmap *bm)
{
+ if (bm == NULL) {
+ return;
+ }
+
g_free(bm->name);
g_free(bm);
}
--
2.9.4
next prev parent reply other threads:[~2017-07-25 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 15:12 [Qemu-devel] [PULL 0/3] Block patches for 2.10-rc0 Max Reitz
2017-07-25 15:12 ` [Qemu-devel] [PULL 1/3] qcow: fix memory leaks related to encryption Max Reitz
2017-07-25 15:12 ` Max Reitz [this message]
2017-07-25 15:12 ` [Qemu-devel] [PULL 3/3] qemu-iotests: Fix reference output for 186 Max Reitz
2017-07-25 16:12 ` [Qemu-devel] [PULL 0/3] Block patches for 2.10-rc0 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=20170725151233.26077-3-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=qemu-block@nongnu.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).