src: don't use VIR_FREE on an object allocation

Memory allocated using g_object_new must never be released using
VIR_FREE/g_free because g_object_new uses a special allocation
strategy internally.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-05-19 15:55:55 +01:00
parent a9fa62f327
commit a771351ae4

View File

@ -752,10 +752,7 @@ static virNetTLSContextPtr virNetTLSContextNew(const char *cacert,
error:
if (isServer)
gnutls_dh_params_deinit(ctxt->dhParams);
if (ctxt->x509cred)
gnutls_certificate_free_credentials(ctxt->x509cred);
VIR_FREE(ctxt->priority);
VIR_FREE(ctxt);
virObjectUnref(ctxt);
return NULL;
}