]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Fri, 1 May 2015 12:55:12 +0000 (08:55 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 6 May 2015 00:02:36 +0000 (20:02 -0400)
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.

src/qemu/qemu_hotplug.c

index 4e9603e88bbef48948b47141fa7b298525f67077..095ed88adb62459a584713c2285227e1beb241b8 100644 (file)
@@ -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);