From: Pan Nengyuan Date: Fri, 23 Oct 2020 06:12:17 +0000 (+0800) Subject: blockdev: Fix a memleak in drive_backup_prepare() X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=94237657af9ac7af6bc9fa0c5d9f0af1a39adb45;p=qmiga%2Fqemu.git 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 Signed-off-by: Pan Nengyuan Reviewed-by: Kevin Wolf Reviewed-by: Li Qiang Signed-off-by: Chen Qun Message-Id: <20201023061218.2080844-7-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- 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; } }