From nobody Sun Feb 8 12:52:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1596791421; cv=none; d=zohomail.com; s=zohoarc; b=ApNC1qD7M8DnQWeG6LrpqZOMll7Jp/xB2ochN2LpCjRXq7jaDWDEZFu5Lr3G1dgmThO890qzXqJYDS/yDGZOtC3VLwb771dHedtcsaFq4rTfkw3tqNH9caIiRGLafvfNniC7xO4kCAqFb4k/2mx8JBXlXKftllZPfmQ+O3/PIIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596791421; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=MMKO89ingXmBkalYu9D9bTDWZu18Q53AZXlCg5ZFQD8=; b=kbk/8b65TD8CIhSqr+ZwRMD2i9qESAZSyTPeUE6mKoFPqOxd1HrtwugDCW3YXJAtFCd9Yy1Va3EVwQKDyL80hbc9SLj52cyKswh1x5e01JeP6IpgkYjKVNmIKBTFoPF563e/H4yAuo5+tBNb6cfkl+w2KfPsL4IPUYcyjz0+A7E= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1596791421236738.1590112191082; Fri, 7 Aug 2020 02:10:21 -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-407-glJ54Xj8NsalE7jXooc3ww-1; Fri, 07 Aug 2020 05:10:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58A7D101C8A0; Fri, 7 Aug 2020 09:10:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB5EB60BE2; Fri, 7 Aug 2020 09:10:09 +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 1C701A35B3; Fri, 7 Aug 2020 09:10:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07795sLs001291 for ; Fri, 7 Aug 2020 05:05:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id D4839103289; Fri, 7 Aug 2020 09:05:54 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D027DFED56 for ; Fri, 7 Aug 2020 09:05:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB2B48007D1 for ; Fri, 7 Aug 2020 09:05:51 +0000 (UTC) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-GecfUFqQPs-solZICXrirQ-1; Fri, 07 Aug 2020 05:05:49 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BEE153FC161F1E3F92D7 for ; Fri, 7 Aug 2020 16:50:04 +0800 (CST) Received: from [127.0.0.1] (10.174.187.239) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 7 Aug 2020 16:49:54 +0800 X-MC-Unique: glJ54Xj8NsalE7jXooc3ww-1 X-MC-Unique: GecfUFqQPs-solZICXrirQ-1 To: From: Jin Yan Subject: [PATCH] virnetserver: fix some memory leaks in virNetTLSContextReloadForServer Message-ID: Date: Fri, 7 Aug 2020 16:49:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Language: en-US X-Originating-IP: [10.174.187.239] X-CFilter-Loop: Reflected X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 07795sLs001291 X-loop: libvir-list@redhat.com Cc: fangying1@huawei.com, alex.chen@huawei.com, zhang.zhanghailiang@huawei.com, zhengchuan@huawei.com, yubihong@huawei.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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable From 55fce33e9cf2d5ea58ebc44b4d78f9c12122fdcb Mon Sep 17 00:00:00 2001 From: Jin Yan Date: Fri, 7 Aug 2020 15:59:45 +0800 Subject: [PATCH] virnetserver: fix some memory leaks in =C2=A0virNetTLSContextReloadForServer These leaks were introduced in commit 15d280fa97b0, use g_autofree for all cert_path pointers. Signed-off-by: Jin Yan --- =C2=A0src/rpc/virnettlscontext.c | 8 ++++---- =C2=A01 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index 168f3010ae..37564db14e 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -921,10 +921,10 @@ int=20 virNetTLSContextReloadForServer(virNetTLSContextPtr ctxt, =C2=A0{ =C2=A0=C2=A0=C2=A0=C2=A0 gnutls_certificate_credentials_t x509credBak; =C2=A0=C2=A0=C2=A0=C2=A0 int err; -=C2=A0=C2=A0=C2=A0 char *cacert =3D NULL; -=C2=A0=C2=A0=C2=A0 char *cacrl =3D NULL; -=C2=A0=C2=A0=C2=A0 char *cert =3D NULL; -=C2=A0=C2=A0=C2=A0 char *key =3D NULL; +=C2=A0=C2=A0=C2=A0 g_autofree char *cacert =3D NULL; +=C2=A0=C2=A0=C2=A0 g_autofree char *cacrl =3D NULL; +=C2=A0=C2=A0=C2=A0 g_autofree char *cert =3D NULL; +=C2=A0=C2=A0=C2=A0 g_autofree char *key =3D NULL; =C2=A0=C2=A0=C2=A0=C2=A0 x509credBak =3D ctxt->x509cred; =C2=A0=C2=A0=C2=A0=C2=A0 ctxt->x509cred =3D NULL; -- 2.23.0