]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuProcessEventSubmit : Unref event->vm instead of vm
authorShaleen Bathla <shaleen.bathla@oracle.com>
Tue, 17 Jan 2023 09:22:13 +0000 (14:52 +0530)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 24 Jan 2023 08:02:43 +0000 (09:02 +0100)
In error case, unref event->vm instead of vm. This makes it
easier for the reader to understand as it is the event struct
that's holding the reference.

Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c

index ee9f0784d3a38400faeff11481150bac3afa5f89..83b553418068b1c7d44e701c1b65f11c8fc13294 100644 (file)
@@ -287,7 +287,7 @@ qemuProcessEventSubmit(virDomainObj *vm,
     event->data = data;
 
     if (virThreadPoolSendJob(driver->workerPool, 0, event) < 0) {
-        virObjectUnref(vm);
+        virObjectUnref(event->vm);
         qemuProcessEventFree(event);
     }
 }