From: John Ferlan Date: Fri, 1 May 2015 12:55:12 +0000 (-0400) Subject: qemu: Resolve Coverity FORWARD_NULL X-Git-Tag: v1.2.16-rc1~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75dfbb85c7292779f32ffc17860f965ebd0edd1f;p=thirdparty%2Flibvirt.git qemu: Resolve Coverity FORWARD_NULL Coverity notes that ->ifname is used after the VIR_FREE done in the code path after the call to virNetDevMacVLanDeleteWithVPortProfile by a call to virNetDevOpenvswitchRemovePort. Since the ->ifname will be VIR_FREE()'d eventually in virDomainNetDefFree just remove the extraneous VIR_FREE here. When originally added, the Openvswitch code wasn't present and checks were made for non NULL prior to use. --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 4e9603e88b..095ed88adb 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1147,7 +1147,6 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, virDomainNetGetActualDirectMode(net), virDomainNetGetActualVirtPortProfile(net), cfg->stateDir)); - VIR_FREE(net->ifname); } vport = virDomainNetGetActualVirtPortProfile(net); @@ -3107,7 +3106,6 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, virDomainNetGetActualDirectMode(net), virDomainNetGetActualVirtPortProfile(net), cfg->stateDir)); - VIR_FREE(net->ifname); } vport = virDomainNetGetActualVirtPortProfile(net);