Since c257352797a a reference of 'cfg' would be leaked if the function
does not need to process anything. Fix it by using VIR_AUTOUNREF.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_blockjob.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index f105632a09..d7e1070c93 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -315,7 +315,7 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
qemuBlockJobDataPtr job,
int asyncJob)
{
- virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+ VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
virDomainDiskDefPtr disk = job->disk;
VIR_DEBUG("disk=%s, mirrorState=%s, type=%d, state=%d, newstate=%d",
@@ -368,8 +368,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
VIR_WARN("Unable to update persistent definition on vm %s "
"after block job", vm->def->name);
}
-
- virObjectUnref(cfg);
}
--
2.21.0