From nobody Sat Apr 27 20:00:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1667398470; cv=none; d=zohomail.com; s=zohoarc; b=M1cDN5ZKgjg3n01gZMbjijH7NcQZ9Xxi/nkmcCcgLUiTPOVZZ6oQ5rG0GtKL2yxfsmdr20pQn3BibeQD54p57I7ft2ttdJPCdXUi0JE7xS+Kc7vwv+9DmwwqO0DejYfIHKQb56Smt3pR9e63cPuwTaXtrjW7afeFcnUT9cRpx3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667398470; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=cUPTfx8RIsEzWo2WAwqCgXa8E0qB9FmJMynYMtVsqdI=; b=WdJ0yQTv9kK9Owb5Wxvoe2AXjfKb3B14ARzmfCJiT6/laFqwHqAMLJG51Qys5Ztcp40kvA6wmFCbcBU9IUj891OAv4horq1HJJBxpK8UKTWR6gyTYgzHr2i7uoADr6JD0xgRuOnfWaOR0qHILnuzGlIC72Oje+Y/aRZml0mc/ec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1667398470988517.7499548475756; Wed, 2 Nov 2022 07:14:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-588-hxCwsY13PNOIEbHVYKaUOg-1; Wed, 02 Nov 2022 10:14:26 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2C13185A7AE; Wed, 2 Nov 2022 14:14:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F1771731B; Wed, 2 Nov 2022 14:14:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6B34A1946597; Wed, 2 Nov 2022 14:14:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D3A861946594 for ; Wed, 2 Nov 2022 14:14:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A6E892166B2B; Wed, 2 Nov 2022 14:14:23 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 84AD92166B2D for ; Wed, 2 Nov 2022 14:14:23 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 6F542243015; Wed, 2 Nov 2022 15:14:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667398469; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cUPTfx8RIsEzWo2WAwqCgXa8E0qB9FmJMynYMtVsqdI=; b=IrDX0rlP5HX4xwUXXP5QKe6GwuvnHaKEardP1mjTUCuBRI7UdPkjDR3ZAWX4yHlMOexccz SEvQ7FhqUeZcoZPOrsJNV7i+PDiYmPblfrUDyi6qFx7PJcXfxikebJ9waNBy4WVl3759T4 zBucz0ymqlw4I0F7nAiS9kgORVVtR44= X-MC-Unique: hxCwsY13PNOIEbHVYKaUOg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] conf: Avoid double free in virDomainEventTunableNew callers Date: Wed, 2 Nov 2022 15:14:20 +0100 Message-Id: <3e48b95da08a2ed9452865b6759430ab460426d1.1667398460.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667398471624100001 Content-Type: text/plain; charset="utf-8" virDomainEventTunableNew is supposed to consume and free @params, but it failed to always set @params to NULL to make sure the caller doesn't try to free the same memory again. Fixes: d95c79fbd00dc597b607b130d95c258b6cf31690 Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index 97d58c2521..7e9bd08381 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -1515,6 +1515,7 @@ virDomainEventTunableNew(int id, =20 error: virTypedParamsFree(*params, nparams); + *params =3D NULL; return NULL; } =20 --=20 2.38.1