[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 11/20] qemu-img: Fix options leakage in img_rebase()
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 11/20] qemu-img: Fix options leakage in img_rebase() |
Date: |
Fri, 14 Jun 2019 15:40:12 +0200 |
img_rebase() can leak a QDict in two occasions. Fix it.
Coverity: CID 1401416
Fixes: d16699b64671466b42079c45b89127aeea1ca565
Fixes: 330c72957196e0ae382abcaa97ebf4eb9bc8574f
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
qemu-img.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qemu-img.c b/qemu-img.c
index fd62e3ad5d..da14aea46a 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3350,6 +3350,7 @@ static int img_rebase(int argc, char **argv)
out_baseimg,
&local_err);
if (local_err) {
+ qobject_unref(options);
error_reportf_err(local_err,
"Could not resolve backing filename: ");
ret = -1;
@@ -3362,7 +3363,9 @@ static int img_rebase(int argc, char **argv)
*/
prefix_chain_bs = bdrv_find_backing_image(bs, out_real_path);
if (prefix_chain_bs) {
+ qobject_unref(options);
g_free(out_real_path);
+
blk_new_backing = blk_new(qemu_get_aio_context(),
BLK_PERM_CONSISTENT_READ,
BLK_PERM_ALL);
--
2.21.0
- [Qemu-block] [PULL 04/20] iotests.py: rewrite run_job to be pickier, (continued)
- [Qemu-block] [PULL 04/20] iotests.py: rewrite run_job to be pickier, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 02/20] iotests.py: do not use infinite waits, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 06/20] event_match: always match on None value, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 08/20] iotests: Fix intermittent failure in 219, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 07/20] iotests: Filter 175's allocation information, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 03/20] QEMUMachine: add events_wait method, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 05/20] iotests: add iotest 256 for testing blockdev-backup across iothread contexts, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 09/20] hw/block/fdc: floppy command FIFO memory initialization, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 10/20] iotests: restrict 254 to support only qcow2, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 12/20] qapi/block-core: Overlays are not snapshots, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 11/20] qemu-img: Fix options leakage in img_rebase(),
Max Reitz <=
- [Qemu-block] [PULL 14/20] qemu-img: Move quiet into ImgConvertState, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 13/20] blockdev: Overlays are not snapshots, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 15/20] qemu-img: Add salvaging mode to convert, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 16/20] blkdebug: Add @iotype error option, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 18/20] blkdebug: Inject errors on .bdrv_co_block_status(), Max Reitz, 2019/06/14
- [Qemu-block] [PULL 17/20] blkdebug: Add "none" event, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 19/20] iotests: Test qemu-img convert --salvage, Max Reitz, 2019/06/14
- [Qemu-block] [PULL 20/20] iotests: Test qemu-img convert -C --salvage, Max Reitz, 2019/06/14
- Re: [Qemu-block] [PULL 00/20] Block patches, Peter Maydell, 2019/06/14