[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt PATCH 2/3] 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>
---
 tools/virsh-completer-checkpoint.c |  8 ++++----
 tools/virsh-completer-domain.c     |  4 ++--
 tools/virsh-completer-interface.c  |  2 +-
 tools/virsh-completer-network.c    | 12 ++++++------
 tools/virsh-completer-nodedev.c    |  2 +-
 tools/virsh-completer-nwfilter.c   |  4 ++--
 tools/virsh-completer-pool.c       |  2 +-
 tools/virsh-completer-secret.c     |  2 +-
 tools/virsh-completer-snapshot.c   |  2 +-
 tools/virsh-completer-volume.c     |  2 +-
 10 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/tools/virsh-completer-checkpoint.c b/tools/virsh-completer-checkpoint.c
index 21e8bb5d3b..0b5af2fa6b 100644
--- a/tools/virsh-completer-checkpoint.c
+++ b/tools/virsh-completer-checkpoint.c
@@ -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;
 }
diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c
index 6bd09dcb0f..8159a0a58d 100644
--- a/tools/virsh-completer-domain.c
+++ b/tools/virsh-completer-domain.c
@@ -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;
 }
 
diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-interface.c
index 417374322a..6ac11a402f 100644
--- a/tools/virsh-completer-interface.c
+++ b/tools/virsh-completer-interface.c
@@ -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;
 }
diff --git a/tools/virsh-completer-network.c b/tools/virsh-completer-network.c
index c215e27720..c29d367c76 100644
--- a/tools/virsh-completer-network.c
+++ b/tools/virsh-completer-network.c
@@ -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;
 }
diff --git a/tools/virsh-completer-nodedev.c b/tools/virsh-completer-nodedev.c
index 5425f11262..94da5965f2 100644
--- a/tools/virsh-completer-nodedev.c
+++ b/tools/virsh-completer-nodedev.c
@@ -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;
 }
 
diff --git a/tools/virsh-completer-nwfilter.c b/tools/virsh-completer-nwfilter.c
index 989a363847..a3fbeded29 100644
--- a/tools/virsh-completer-nwfilter.c
+++ b/tools/virsh-completer-nwfilter.c
@@ -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;
 }
diff --git a/tools/virsh-completer-pool.c b/tools/virsh-completer-pool.c
index ed3b1e35ff..35eeed6043 100644
--- a/tools/virsh-completer-pool.c
+++ b/tools/virsh-completer-pool.c
@@ -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;
 }
 
diff --git a/tools/virsh-completer-secret.c b/tools/virsh-completer-secret.c
index 505b19db84..568599c6e4 100644
--- a/tools/virsh-completer-secret.c
+++ b/tools/virsh-completer-secret.c
@@ -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;
 }
 
diff --git a/tools/virsh-completer-snapshot.c b/tools/virsh-completer-snapshot.c
index aa1135d132..9ab74bb471 100644
--- a/tools/virsh-completer-snapshot.c
+++ b/tools/virsh-completer-snapshot.c
@@ -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;
 }
diff --git a/tools/virsh-completer-volume.c b/tools/virsh-completer-volume.c
index ad54261534..296e67dd71 100644
--- a/tools/virsh-completer-volume.c
+++ b/tools/virsh-completer-volume.c
@@ -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;
 }
-- 
2.26.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]