aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorPan Nengyuan <pannengyuan@huawei.com>2020-10-23 14:12:17 +0800
committerLaurent Vivier <laurent@vivier.eu>2020-12-13 23:56:16 +0100
commit94237657af9ac7af6bc9fa0c5d9f0af1a39adb45 (patch)
tree1c3687de815a8a806d4fdeff3a79520c5d44e619 /blockdev.c
parentcb8d0851f1c00daafd736757a22f4820ec081b68 (diff)
blockdev: Fix a memleak in drive_backup_prepare()
'local_err' seems forgot to propagate in error path, it'll cause a memleak. Fix it. Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com> Message-Id: <20201023061218.2080844-7-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 412354b4b6..2431448c5d 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1827,6 +1827,7 @@ static void drive_backup_prepare(BlkActionState *common, Error **errp)
if (set_backing_hd) {
bdrv_set_backing_hd(target_bs, source, &local_err);
if (local_err) {
+ error_propagate(errp, local_err);
goto unref;
}
}