From nobody Mon Feb 9 04:46:02 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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=1595413682; cv=none; d=zohomail.com; s=zohoarc; b=NjSY/za5CpX7NP8dxAdSPjFDdOv23Xu7Vp6wHYM1O2s0hA0vENyynHpP6ASb8EM1B76Hvnb5mF8sWenYNQH4N5pM4Zb7h7KjuMyLbVSODmcukC55fb3RFs3gnZ+B6lxmxhENOC8tEeh3qZ+P7bRiyWRHE2NypAnYGKvB9bjlGOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595413682; 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=RIbIqbx9Uk47qFV9Hqc8MLpj2eVlhzkIg47I7xl2F5E=; b=eaTaTKmzHNJK8IjIbND0dVQ4JgAMfZUh/xRy6ItukgMViXdPEBQDWLRzzqtNARxsXwlio61a0VslSS/lzE0cST6MaEGKECxnELWFK3Gvl8EH8nnpXMz7Y8yKZHkIdqEohwNY6whpHhp8WmT0pDgDX1cIoG44tocMi7mk9IAAQVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 1595413682693997.8849880697528; Wed, 22 Jul 2020 03:28:02 -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-363-q4l4WM3qOki6mLla9VIIMg-1; Wed, 22 Jul 2020 06:27:59 -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 782C318C63C2; Wed, 22 Jul 2020 10:27:53 +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 51FAC610AF; Wed, 22 Jul 2020 10:27:53 +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 D41841809554; Wed, 22 Jul 2020 10:27:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06M9ejt7000883 for ; Wed, 22 Jul 2020 05:40:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0A0951A8F7; Wed, 22 Jul 2020 09:40:45 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CEFF2B4DA for ; Wed, 22 Jul 2020 09:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595413681; 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=RIbIqbx9Uk47qFV9Hqc8MLpj2eVlhzkIg47I7xl2F5E=; b=RT13wxWauRwOMBPq58pWXkeG0PFxJtLOtR3q7kLsH1jfmyBfDiFYsJ3tElFXOVuZl6vstv 0FLq1BQzi8Zkx6nS8t5zYgJlC5h3HM7+Tg2dBQdKKPsFNnU+wHjpVvkYsDGSB8pQwaqgqD rbWc8tyCRkodrQXKoiFXPeTiDYCdg6I= X-MC-Unique: q4l4WM3qOki6mLla9VIIMg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 08/34] qemuDomainAttachDeviceMknodHelper: Don't leak data->target Date: Wed, 22 Jul 2020 11:40:02 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.12 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" It's not really a problem since this is a helper process that dies as soon as the helper function returns, but the cleanup code will be replaced with a function soon and this change prepares the code for that. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain_namespace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namesp= ace.c index 6bd1fb30cf..e385cda64a 100644 --- a/src/qemu/qemu_domain_namespace.c +++ b/src/qemu/qemu_domain_namespace.c @@ -1102,7 +1102,7 @@ struct qemuDomainAttachDeviceMknodData { virQEMUDriverPtr driver; virDomainObjPtr vm; const char *file; - const char *target; + char *target; GStatBuf sb; void *acl; #ifdef WITH_SELINUX @@ -1248,6 +1248,7 @@ qemuDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UN= USED, freecon(data->tcon); # endif virFileFreeACLs(&data->acl); + VIR_FREE(data->target); return ret; } =20 --=20 2.26.2