]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_process: Resolve Coverity RESOURCE_LEAK
authorWang Rui <moon.wangrui@huawei.com>
Mon, 1 Sep 2014 12:08:06 +0000 (20:08 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 3 Sep 2014 19:00:19 +0000 (15:00 -0400)
If virSecurityManagerClearSocketLabel() fails, 'agent' won't
be freed before jumping to cleanup.

Signed-off-by: Wang Rui <moon.wangrui@huawei.com>
src/qemu/qemu_process.c

index f76aa5a3b6114790f52fdb64c0a79cd6f01fdfd4..d9547b2064016bfd5a93a94c11b28d532b77cf1c 100644 (file)
@@ -264,6 +264,7 @@ qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm)
                                            vm->def) < 0) {
         VIR_ERROR(_("Failed to clear security context for agent for %s"),
                   vm->def->name);
+        qemuAgentClose(agent);
         goto cleanup;
     }