mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
virsh-completer: use g_free instead of VIR_FREE
All of them are in the cleanup section right before the variables they free go out of scope. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
a698dfae9b
commit
acdac34c45
@ -60,7 +60,7 @@ virshCheckpointNameCompleter(vshControl *ctl,
|
||||
|
||||
virshDomainCheckpointFree(checkpoints[i]);
|
||||
}
|
||||
VIR_FREE(checkpoints);
|
||||
g_free(checkpoints);
|
||||
virshDomainFree(dom);
|
||||
|
||||
return ret;
|
||||
@ -68,10 +68,10 @@ virshCheckpointNameCompleter(vshControl *ctl,
|
||||
error:
|
||||
for (; i < ncheckpoints; i++)
|
||||
virshDomainCheckpointFree(checkpoints[i]);
|
||||
VIR_FREE(checkpoints);
|
||||
g_free(checkpoints);
|
||||
for (i = 0; i < ncheckpoints; i++)
|
||||
VIR_FREE(ret[i]);
|
||||
VIR_FREE(ret);
|
||||
g_free(ret[i]);
|
||||
g_free(ret);
|
||||
virshDomainFree(dom);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ virshDomainNameCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < ndomains; i++)
|
||||
virshDomainFree(domains[i]);
|
||||
VIR_FREE(domains);
|
||||
g_free(domains);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ virshDomainUUIDCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < ndomains; i++)
|
||||
virshDomainFree(domains[i]);
|
||||
VIR_FREE(domains);
|
||||
g_free(domains);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,6 @@ virshInterfaceNameCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < nifaces; i++)
|
||||
virInterfaceFree(ifaces[i]);
|
||||
VIR_FREE(ifaces);
|
||||
g_free(ifaces);
|
||||
return ret;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ virshNetworkNameCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < nnets; i++)
|
||||
virNetworkFree(nets[i]);
|
||||
VIR_FREE(nets);
|
||||
g_free(nets);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -124,17 +124,17 @@ virshNetworkPortUUIDCompleter(vshControl *ctl,
|
||||
|
||||
virNetworkPortFree(ports[i]);
|
||||
}
|
||||
VIR_FREE(ports);
|
||||
g_free(ports);
|
||||
|
||||
return ret;
|
||||
|
||||
error:
|
||||
for (; i < nports; i++)
|
||||
virNetworkPortFree(ports[i]);
|
||||
VIR_FREE(ports);
|
||||
g_free(ports);
|
||||
for (i = 0; i < nports; i++)
|
||||
VIR_FREE(ret[i]);
|
||||
VIR_FREE(ret);
|
||||
g_free(ret[i]);
|
||||
g_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -176,6 +176,6 @@ virshNetworkUUIDCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < nnets; i++)
|
||||
virNetworkFree(nets[i]);
|
||||
VIR_FREE(nets);
|
||||
g_free(nets);
|
||||
return ret;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ virshNodeDeviceNameCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < ndevs; i++)
|
||||
virNodeDeviceFree(devs[i]);
|
||||
VIR_FREE(devs);
|
||||
g_free(devs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ virshNWFilterNameCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < nnwfilters; i++)
|
||||
virNWFilterFree(nwfilters[i]);
|
||||
VIR_FREE(nwfilters);
|
||||
g_free(nwfilters);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -98,6 +98,6 @@ virshNWFilterBindingNameCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < nbindings; i++)
|
||||
virNWFilterBindingFree(bindings[i]);
|
||||
VIR_FREE(bindings);
|
||||
g_free(bindings);
|
||||
return ret;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ virshStoragePoolNameCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < npools; i++)
|
||||
virStoragePoolFree(pools[i]);
|
||||
VIR_FREE(pools);
|
||||
g_free(pools);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ virshSecretUUIDCompleter(vshControl *ctl,
|
||||
cleanup:
|
||||
for (i = 0; i < nsecrets; i++)
|
||||
virshSecretFree(secrets[i]);
|
||||
VIR_FREE(secrets);
|
||||
g_free(secrets);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,6 @@ virshSnapshotNameCompleter(vshControl *ctl,
|
||||
virshDomainFree(dom);
|
||||
for (i = 0; i < nsnapshots; i++)
|
||||
virshDomainSnapshotFree(snapshots[i]);
|
||||
VIR_FREE(snapshots);
|
||||
g_free(snapshots);
|
||||
return ret;
|
||||
}
|
||||
|
@ -67,6 +67,6 @@ virshStorageVolNameCompleter(vshControl *ctl,
|
||||
virStoragePoolFree(pool);
|
||||
for (i = 0; i < nvols; i++)
|
||||
virStorageVolFree(vols[i]);
|
||||
VIR_FREE(vols);
|
||||
g_free(vols);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user