This reverts commit
443c79dd7f7d4051fc0084baaa6c56a55d2aace4.
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>
esxUtil_FreeParsedUri(&(*priv)->parsedUri);
virObjectUnref((*priv)->caps);
virObjectUnref((*priv)->xmlopt);
- g_free(*priv);
+ VIR_FREE(*priv);
}
return;
esxVI_CURL_Free(&(*priv)->curl);
- g_free((*priv)->backlog);
- g_free(*priv);
+ VIR_FREE((*priv)->backlog);
+ VIR_FREE(*priv);
}
static int
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);
}