mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
Revert "esx: switch VIR_FREE->g_free in esx*Free*()"
This reverts commit 443c79dd7f.
Change from VIR_FREE() to g_free meant there is a possible double free
when there is an error during parsing because the parsing it done
directly into the parsedUri member of the esxPrivate, free'd when it
fails and then the caller calls free on it again. Changing back to
VIR_FREE() means there is no double free and no crash.
Reproducible easily with `virsh -c esx://l?no_verify=2`.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
1 parent
77bd314656
commit
af83ac00eb
3 files changed
+10
-9
No files matched your search
@@ -63,7 +63,7 @@ esxFreePrivate(esxPrivate **priv)
|
||||
esxUtil_FreeParsedUri(&(*priv)->parsedUri);
|
||||
virObjectUnref((*priv)->caps);
|
||||
virObjectUnref((*priv)->xmlopt);
|
||||
g_free(*priv);
|
||||
VIR_FREE(*priv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -321,8 +321,8 @@ esxFreeStreamPrivate(esxStreamPrivate **priv)
|
||||
return;
|
||||
|
||||
esxVI_CURL_Free(&(*priv)->curl);
|
||||
g_free((*priv)->backlog);
|
||||
g_free(*priv);
|
||||
VIR_FREE((*priv)->backlog);
|
||||
VIR_FREE(*priv);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
+7
-6
@@ -165,13 +165,14 @@ esxUtil_FreeParsedUri(esxUtil_ParsedUri **parsedUri)
|
||||
if (!parsedUri || !(*parsedUri))
|
||||
return;
|
||||
|
||||
g_free((*parsedUri)->transport);
|
||||
g_free((*parsedUri)->vCenter);
|
||||
g_free((*parsedUri)->proxy_hostname);
|
||||
g_free((*parsedUri)->path);
|
||||
g_free((*parsedUri)->cacert);
|
||||
|
||||
g_free(*parsedUri);
|
||||
VIR_FREE((*parsedUri)->transport);
|
||||
VIR_FREE((*parsedUri)->vCenter);
|
||||
VIR_FREE((*parsedUri)->proxy_hostname);
|
||||
VIR_FREE((*parsedUri)->path);
|
||||
VIR_FREE((*parsedUri)->cacert);
|
||||
|
||||
VIR_FREE(*parsedUri);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user