mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Use g_steal_pointer where possible
Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
bcb63a3bdc
commit
e4dd2a2c2e
@ -5466,8 +5466,7 @@ networkPortSetParameters(virNetworkPortPtr port,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virNetDevBandwidthFree(portdef->bandwidth);
|
virNetDevBandwidthFree(portdef->bandwidth);
|
||||||
portdef->bandwidth = bandwidth;
|
portdef->bandwidth = g_steal_pointer(&bandwidth);
|
||||||
bandwidth = NULL;
|
|
||||||
|
|
||||||
if (virNetworkPortDefSaveStatus(portdef, dir) < 0)
|
if (virNetworkPortDefSaveStatus(portdef, dir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -10372,8 +10372,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
|
|
||||||
virNetDevBandwidthFree(net->bandwidth);
|
virNetDevBandwidthFree(net->bandwidth);
|
||||||
if (newBandwidth->in || newBandwidth->out) {
|
if (newBandwidth->in || newBandwidth->out) {
|
||||||
net->bandwidth = newBandwidth;
|
net->bandwidth = g_steal_pointer(&newBandwidth);
|
||||||
newBandwidth = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
net->bandwidth = NULL;
|
net->bandwidth = NULL;
|
||||||
}
|
}
|
||||||
@ -10391,8 +10390,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
|
|
||||||
if (persistentNet) {
|
if (persistentNet) {
|
||||||
if (!persistentNet->bandwidth) {
|
if (!persistentNet->bandwidth) {
|
||||||
persistentNet->bandwidth = bandwidth;
|
persistentNet->bandwidth = g_steal_pointer(&bandwidth);
|
||||||
bandwidth = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
if (bandwidth->in) {
|
if (bandwidth->in) {
|
||||||
VIR_FREE(persistentNet->bandwidth->in);
|
VIR_FREE(persistentNet->bandwidth->in);
|
||||||
|
Loading…
Reference in New Issue
Block a user