]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx: switch VIR_FREE->g_free in esx*Free*()
authorLaine Stump <laine@redhat.com>
Fri, 12 Feb 2021 19:13:03 +0000 (14:13 -0500)
committerLaine Stump <laine@redhat.com>
Tue, 16 Feb 2021 18:50:04 +0000 (13:50 -0500)
Although the three functions esxFreePrivate(), esxFreeStreamPrivate(),
and esxUtil_FreeParsedUri() are calling VIR_FREE on *object, and so in
theory the caller of the function might rely on "object" (the free
function's arg) being set to NULL, in practice these functions are
only called from a couple places each, and in all cases the pointer
that is passed is a local variable, and goes out of scope almost
immediately after calling the Free function, so it is safe to change
VIR_FREE() into g_free().

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/esx/esx_driver.c
src/esx/esx_stream.c
src/esx/esx_util.c

index 8afec464dde07712927f0ede3da56d620de1a174..952e76937637c3057eed21863599b4f55b47386e 100644 (file)
@@ -71,7 +71,7 @@ esxFreePrivate(esxPrivate **priv)
     esxUtil_FreeParsedUri(&(*priv)->parsedUri);
     virObjectUnref((*priv)->caps);
     virObjectUnref((*priv)->xmlopt);
-    VIR_FREE(*priv);
+    g_free(*priv);
 }
 
 
index cc48c182d937d34bc750effcf2b5e316e0ab946b..131fbc100b45aefe520160f7d9f1e78a26f1b55f 100644 (file)
@@ -336,8 +336,8 @@ esxFreeStreamPrivate(esxStreamPrivate **priv)
         return;
 
     esxVI_CURL_Free(&(*priv)->curl);
-    VIR_FREE((*priv)->backlog);
-    VIR_FREE(*priv);
+    g_free((*priv)->backlog);
+    g_free(*priv);
 }
 
 static int
index 64a2c968f07520e7d41e22fa55042de7a8031bdb..e9b74f386f89a8f394675c7503463c8bc62eace4 100644 (file)
@@ -171,12 +171,12 @@ esxUtil_FreeParsedUri(esxUtil_ParsedUri **parsedUri)
     if (!parsedUri || !(*parsedUri))
         return;
 
-    VIR_FREE((*parsedUri)->transport);
-    VIR_FREE((*parsedUri)->vCenter);
-    VIR_FREE((*parsedUri)->proxy_hostname);
-    VIR_FREE((*parsedUri)->path);
+    g_free((*parsedUri)->transport);
+    g_free((*parsedUri)->vCenter);
+    g_free((*parsedUri)->proxy_hostname);
+    g_free((*parsedUri)->path);
 
-    VIR_FREE(*parsedUri);
+    g_free(*parsedUri);
 }