[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/14] backup: Don't leak BackupBlockJob in error pa
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 08/14] backup: Don't leak BackupBlockJob in error path |
Date: |
Wed, 4 May 2016 11:39:19 +0200 |
Signed-off-by: Kevin Wolf <address@hidden>
---
block/backup.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/backup.c b/block/backup.c
index fec45e8..a990cf1 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -485,6 +485,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState
*target,
{
int64_t len;
BlockDriverInfo bdi;
+ BackupBlockJob *job = NULL;
int ret;
assert(bs);
@@ -542,8 +543,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState
*target,
goto error;
}
- BackupBlockJob *job = block_job_create(&backup_job_driver, bs, speed,
- cb, opaque, errp);
+ job = block_job_create(&backup_job_driver, bs, speed, cb, opaque, errp);
if (!job) {
goto error;
}
@@ -584,4 +584,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState
*target,
if (sync_bitmap) {
bdrv_reclaim_dirty_bitmap(bs, sync_bitmap, NULL);
}
+ if (job) {
+ block_job_unref(&job->common);
+ }
}
--
1.8.3.1
- [Qemu-devel] [PATCH 03/14] block: Default to enabled write cache in blk_new(), (continued)
- [Qemu-devel] [PATCH 03/14] block: Default to enabled write cache in blk_new(), Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 04/14] block: Convert block job core to BlockBackend, Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 05/14] stream: Use BlockBackend for I/O, Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 06/14] mirror: Allow target that already has a BlockBackend, Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 01/14] block: keep a list of block jobs, Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 08/14] backup: Don't leak BackupBlockJob in error path,
Kevin Wolf <=
- [Qemu-devel] [PATCH 02/14] block: Cancel jobs first in bdrv_close_all(), Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 11/14] block: Add blk_co_readv/writev(), Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 10/14] backup: Remove bs parameter from backup_do_cow(), Kevin Wolf, 2016/05/04
- [Qemu-devel] [PATCH 14/14] blockjob: Remove BlockJob.bs, Kevin Wolf, 2016/05/04