From a771351ae49c0b8f5fce8664fd11345874b045d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 19 May 2020 15:55:55 +0100 Subject: [PATCH] src: don't use VIR_FREE on an object allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Daniel P. Berrangé --- src/rpc/virnettlscontext.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index 02c17124a1..a8104cf484 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -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; } -- 2.47.2