1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-12 13:17:58 +03:00

parallels: Resolve Coverity USE_AFTER_FREE

Coverity complains that calling virNetworkDefFree(def), then jumping
to the cleanup: label which calls virNetworkDefFree(def) could result
in a double_free.  Just remove the call from the if statement.
This commit is contained in:
John Ferlan 2014-08-27 07:32:11 -04:00
parent a6a210b879
commit 0da9a8a8bf

View File

@ -226,10 +226,8 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
goto cleanup;
}
if (!(net = virNetworkAssignDef(&privconn->networks, def, false))) {
virNetworkDefFree(def);
if (!(net = virNetworkAssignDef(&privconn->networks, def, false)))
goto cleanup;
}
net->active = 1;
net->autostart = 1;
virNetworkObjUnlock(net);