From nobody Mon Feb 9 06:50:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1583401940; cv=none; d=zohomail.com; s=zohoarc; b=DmpWproxWIZT50hwiwb9HynhCjA3VQ8TVMU/cF9I54wHIitVySFHclL+eKAi1hA3aGCbfSWdOS1HzUKIAwj01Xpn1OzEpSYUTC4Il1BBNn7T+ZndkkC94Okey3YDImaU0oq+R/RU+ED/Ehg0qatp6RnLcvDoJa0SqcbY/KNTWzE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583401940; 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=bc5dEFzhDQnzAVZZbbVEOXkEvIdqhQlqT0+4Xnx9lbs=; b=BLVAPdD7hrkA7Lor6mbTKlY8jsCk49u73gN9hqLkrqxijSxqVY+fcqB+mzlnGf9m6zczQwCXdmpJiJz0zuDFHw0WrDW+K9p+cYxheMY0+hck+FEeaXC0SzcThR8M7yQFMWIvDjTpvZToiN/Osx4vhQCezLEDniQUvOvlphImG6E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1583401940337354.36847096815904; Thu, 5 Mar 2020 01:52:20 -0800 (PST) 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-287-5G2xeFoVNYCsr3uLtLY3TQ-1; Thu, 05 Mar 2020 04:52:16 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3537D107ACCD; Thu, 5 Mar 2020 09:52:11 +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 CD23E19C6A; Thu, 5 Mar 2020 09:52:10 +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 67C8D35AE1; Thu, 5 Mar 2020 09:52:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0259q8Sx023326 for ; Thu, 5 Mar 2020 04:52:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7AE5B90779; Thu, 5 Mar 2020 09:52:08 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01F9F90538 for ; Thu, 5 Mar 2020 09:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583401939; 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=bc5dEFzhDQnzAVZZbbVEOXkEvIdqhQlqT0+4Xnx9lbs=; b=iLQfkGWixKDsZTfEI5MVifBgvNUwJmwDFYxtCA7NnPnA1e1S9M3Y7nXsUajjEeL/O55n8c F5CAjHQxzASNj7v5Qgb3U0BSbV+iZh6IHh/12AOxu6C11gYfr/vJSAJzHlB5t/WNjnlEgU 0mI+ckXTrtyXcluHX+JDBSmTde0nQ/o= X-MC-Unique: 5G2xeFoVNYCsr3uLtLY3TQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/5] virLXCProcessSetupNamespaceName: Fix potential uninitialized free of 'path' Date: Thu, 5 Mar 2020 10:51:59 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 'path' could be accessed uninitialized. Fix it by using g_autofree which also mandates initialization. Signed-off-by: Peter Krempa --- src/lxc/lxc_process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 0277ba8b62..cd0026f78f 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -409,7 +409,7 @@ static int virLXCProcessSetupNamespaceName(virLXCDriver= Ptr driver, int fd =3D -1; virDomainObjPtr vm; virLXCDomainObjPrivatePtr priv; - char *path; + g_autofree char *path =3D NULL; vm =3D virDomainObjListFindByName(driver->domains, name); if (!vm) { @@ -436,7 +436,6 @@ static int virLXCProcessSetupNamespaceName(virLXCDriver= Ptr driver, } cleanup: - VIR_FREE(path); virDomainObjEndAPI(&vm); return fd; } --=20 2.24.1