mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-29 04:52:22 -06:00
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>
This commit is contained in:
parent
cb8d0851f1
commit
94237657af
1 changed files with 1 additions and 0 deletions
|
@ -1827,6 +1827,7 @@ static void drive_backup_prepare(BlkActionState *common, Error **errp)
|
||||||
if (set_backing_hd) {
|
if (set_backing_hd) {
|
||||||
bdrv_set_backing_hd(target_bs, source, &local_err);
|
bdrv_set_backing_hd(target_bs, source, &local_err);
|
||||||
if (local_err) {
|
if (local_err) {
|
||||||
|
error_propagate(errp, local_err);
|
||||||
goto unref;
|
goto unref;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue