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>
goto cleanup;
virNetDevBandwidthFree(portdef->bandwidth);
- portdef->bandwidth = bandwidth;
- bandwidth = NULL;
+ portdef->bandwidth = g_steal_pointer(&bandwidth);
if (virNetworkPortDefSaveStatus(portdef, dir) < 0)
goto cleanup;
virNetDevBandwidthFree(net->bandwidth);
if (newBandwidth->in || newBandwidth->out) {
- net->bandwidth = newBandwidth;
- newBandwidth = NULL;
+ net->bandwidth = g_steal_pointer(&newBandwidth);
} else {
net->bandwidth = NULL;
}
if (persistentNet) {
if (!persistentNet->bandwidth) {
- persistentNet->bandwidth = bandwidth;
- bandwidth = NULL;
+ persistentNet->bandwidth = g_steal_pointer(&bandwidth);
} else {
if (bandwidth->in) {
VIR_FREE(persistentNet->bandwidth->in);