From nobody Sun Feb 8 05:07:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589910550; cv=none; d=zohomail.com; s=zohoarc; b=LKPx1JHcCCJmzEEMa5YyHxUbNuagMOHUw7WdW62bbgf8ilVdxzKAPmZMASyNppG+KSdsUVBwuRG5zxN+wv+SBaNRKfJttqj5n9iYqZHH/n6cZG+I155370WAfnKZYqEdH1f3ZpWTFIZKZCzTKfY3fXWOsBRgCq2r5orhhv0hz/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589910550; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c6vied4Ejoc1dOXkqYtNPtnXLVUEXQncanyt2rtwW14=; b=fhm7h6DWp8p9qIiqicVjU0GSLlENb6QC/flS88ehzcbxn6hh5jzL7CDKeVYuF7cgBBQ4+5ifuhxzcop//l9ymlP31IfQkOEiY4K7ZOWg/cikh2yPiudgMeSiQkJRJubL2W2LfNZdjx1Qq16AVUTHT0qbgytL8qUzgQUGR7RFgjE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1589910550975384.2509871438558; Tue, 19 May 2020 10:49:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-1SsX_VC-OfKke9tEXlbLFw-1; Tue, 19 May 2020 13:48:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8016805721; Tue, 19 May 2020 17:48:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA0285C1D0; Tue, 19 May 2020 17:48:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 783F81809557; Tue, 19 May 2020 17:48:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04JHliPY014514 for ; Tue, 19 May 2020 13:47:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD5285D9DD; Tue, 19 May 2020 17:47:44 +0000 (UTC) Received: from catbus.gsslab.fab.redhat.com (mustard.gsslab.fab.redhat.com [10.33.8.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BA775D9C5; Tue, 19 May 2020 17:47:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589910549; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=c6vied4Ejoc1dOXkqYtNPtnXLVUEXQncanyt2rtwW14=; b=eUXoENLW1Wuf+9Igiak0sKvD/fDUyD1joN5OqG+REN9dlfEIvkcug1L6JcDoxf6KH7eVYd fuY4sePcFfoBdfuXiTijAiUX1H3cj+bTONBP6XYiHLZqP6r3ITLjbzqRjjpWHXGxbqmD4U TonJCWsuaRdbzPRzV2Bsj3hXpO88x/0= X-MC-Unique: 1SsX_VC-OfKke9tEXlbLFw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/6] src: don't use VIR_FREE on an object allocation Date: Tue, 19 May 2020 18:41:30 +0100 Message-Id: <20200519174131.91783-6-berrange@redhat.com> In-Reply-To: <20200519174131.91783-1-berrange@redhat.com> References: <20200519174131.91783-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) 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. Signed-off-by: Daniel P. Berrang=C3=A9 --- 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..ced0cbdcd8 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -750,12 +750,9 @@ static virNetTLSContextPtr virNetTLSContextNew(const c= har *cacert, return ctxt; =20 error: + virObjectUnref(ctxt); if (isServer) gnutls_dh_params_deinit(ctxt->dhParams); - if (ctxt->x509cred) - gnutls_certificate_free_credentials(ctxt->x509cred); - VIR_FREE(ctxt->priority); - VIR_FREE(ctxt); return NULL; } =20 --=20 2.24.1