mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +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]);
|
virshDomainCheckpointFree(checkpoints[i]);
|
||||||
}
|
}
|
||||||
VIR_FREE(checkpoints);
|
g_free(checkpoints);
|
||||||
virshDomainFree(dom);
|
virshDomainFree(dom);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -68,10 +68,10 @@ virshCheckpointNameCompleter(vshControl *ctl,
|
|||||||
error:
|
error:
|
||||||
for (; i < ncheckpoints; i++)
|
for (; i < ncheckpoints; i++)
|
||||||
virshDomainCheckpointFree(checkpoints[i]);
|
virshDomainCheckpointFree(checkpoints[i]);
|
||||||
VIR_FREE(checkpoints);
|
g_free(checkpoints);
|
||||||
for (i = 0; i < ncheckpoints; i++)
|
for (i = 0; i < ncheckpoints; i++)
|
||||||
VIR_FREE(ret[i]);
|
g_free(ret[i]);
|
||||||
VIR_FREE(ret);
|
g_free(ret);
|
||||||
virshDomainFree(dom);
|
virshDomainFree(dom);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ virshDomainNameCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < ndomains; i++)
|
for (i = 0; i < ndomains; i++)
|
||||||
virshDomainFree(domains[i]);
|
virshDomainFree(domains[i]);
|
||||||
VIR_FREE(domains);
|
g_free(domains);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ virshDomainUUIDCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < ndomains; i++)
|
for (i = 0; i < ndomains; i++)
|
||||||
virshDomainFree(domains[i]);
|
virshDomainFree(domains[i]);
|
||||||
VIR_FREE(domains);
|
g_free(domains);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,6 @@ virshInterfaceNameCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nifaces; i++)
|
for (i = 0; i < nifaces; i++)
|
||||||
virInterfaceFree(ifaces[i]);
|
virInterfaceFree(ifaces[i]);
|
||||||
VIR_FREE(ifaces);
|
g_free(ifaces);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ virshNetworkNameCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nnets; i++)
|
for (i = 0; i < nnets; i++)
|
||||||
virNetworkFree(nets[i]);
|
virNetworkFree(nets[i]);
|
||||||
VIR_FREE(nets);
|
g_free(nets);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,17 +124,17 @@ virshNetworkPortUUIDCompleter(vshControl *ctl,
|
|||||||
|
|
||||||
virNetworkPortFree(ports[i]);
|
virNetworkPortFree(ports[i]);
|
||||||
}
|
}
|
||||||
VIR_FREE(ports);
|
g_free(ports);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
for (; i < nports; i++)
|
for (; i < nports; i++)
|
||||||
virNetworkPortFree(ports[i]);
|
virNetworkPortFree(ports[i]);
|
||||||
VIR_FREE(ports);
|
g_free(ports);
|
||||||
for (i = 0; i < nports; i++)
|
for (i = 0; i < nports; i++)
|
||||||
VIR_FREE(ret[i]);
|
g_free(ret[i]);
|
||||||
VIR_FREE(ret);
|
g_free(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +176,6 @@ virshNetworkUUIDCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nnets; i++)
|
for (i = 0; i < nnets; i++)
|
||||||
virNetworkFree(nets[i]);
|
virNetworkFree(nets[i]);
|
||||||
VIR_FREE(nets);
|
g_free(nets);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ virshNodeDeviceNameCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < ndevs; i++)
|
for (i = 0; i < ndevs; i++)
|
||||||
virNodeDeviceFree(devs[i]);
|
virNodeDeviceFree(devs[i]);
|
||||||
VIR_FREE(devs);
|
g_free(devs);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ virshNWFilterNameCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nnwfilters; i++)
|
for (i = 0; i < nnwfilters; i++)
|
||||||
virNWFilterFree(nwfilters[i]);
|
virNWFilterFree(nwfilters[i]);
|
||||||
VIR_FREE(nwfilters);
|
g_free(nwfilters);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +98,6 @@ virshNWFilterBindingNameCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nbindings; i++)
|
for (i = 0; i < nbindings; i++)
|
||||||
virNWFilterBindingFree(bindings[i]);
|
virNWFilterBindingFree(bindings[i]);
|
||||||
VIR_FREE(bindings);
|
g_free(bindings);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ virshStoragePoolNameCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < npools; i++)
|
for (i = 0; i < npools; i++)
|
||||||
virStoragePoolFree(pools[i]);
|
virStoragePoolFree(pools[i]);
|
||||||
VIR_FREE(pools);
|
g_free(pools);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ virshSecretUUIDCompleter(vshControl *ctl,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nsecrets; i++)
|
for (i = 0; i < nsecrets; i++)
|
||||||
virshSecretFree(secrets[i]);
|
virshSecretFree(secrets[i]);
|
||||||
VIR_FREE(secrets);
|
g_free(secrets);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,6 @@ virshSnapshotNameCompleter(vshControl *ctl,
|
|||||||
virshDomainFree(dom);
|
virshDomainFree(dom);
|
||||||
for (i = 0; i < nsnapshots; i++)
|
for (i = 0; i < nsnapshots; i++)
|
||||||
virshDomainSnapshotFree(snapshots[i]);
|
virshDomainSnapshotFree(snapshots[i]);
|
||||||
VIR_FREE(snapshots);
|
g_free(snapshots);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,6 @@ virshStorageVolNameCompleter(vshControl *ctl,
|
|||||||
virStoragePoolFree(pool);
|
virStoragePoolFree(pool);
|
||||||
for (i = 0; i < nvols; i++)
|
for (i = 0; i < nvols; i++)
|
||||||
virStorageVolFree(vols[i]);
|
virStorageVolFree(vols[i]);
|
||||||
VIR_FREE(vols);
|
g_free(vols);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user