mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-20 18:03:50 +03:00
esx: switch VIR_FREE->g_free in esx*Free*()
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>
This commit is contained in:
parent
d79a6e2c8c
commit
443c79dd7f
@ -71,7 +71,7 @@ esxFreePrivate(esxPrivate **priv)
|
||||
esxUtil_FreeParsedUri(&(*priv)->parsedUri);
|
||||
virObjectUnref((*priv)->caps);
|
||||
virObjectUnref((*priv)->xmlopt);
|
||||
VIR_FREE(*priv);
|
||||
g_free(*priv);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user