From nobody Thu Apr 25 19:27:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1610028379; cv=none; d=zohomail.com; s=zohoarc; b=l4ZRkoIyUWDovqMcxh3HiKP0dodoeb9tp34Dq18RcC6Nf+QiBw9xtC9G9+9W2CFBhcmxrPzEiXn000HEfACqqK1yYtF7EDX3yODtZYcYNXawHdLbhURFXkW+ol6bTVKeb2evM6nhyaQiH3CtoI9H/xfyum5ccSCKPEHO9/3xm9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610028379; 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=EA3aPIpcUdDkzw8FAJZ2Q2NP3oXbthtOWrt3EagkI80=; b=WRp0yWnWpAOuByI4yq5pK0n1G+QiGoWWA+05H19R8Rv681RI2PJrFmAALMbD6rWjVLq0gSSJrPvjjYwbfJQgoVDeHCcv67myblsCK/YGFwhwVe9Rt5jFxfnEIgMrZBiuiLbMAciwWhH8PLx3d3rbb9JaAKv/AmHwny/VMjZJLW8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610028379002796.3033497140816; Thu, 7 Jan 2021 06:06:19 -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-3-CZr2VEj3OzW1PngaTmWBdw-1; Thu, 07 Jan 2021 09:06:14 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25C68107ACE4; Thu, 7 Jan 2021 14:06:08 +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 4652F12D7E; Thu, 7 Jan 2021 14:06:07 +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 52E0F4BB7B; Thu, 7 Jan 2021 14:06:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 107E63KF030997 for ; Thu, 7 Jan 2021 09:06:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id CEAED1724C; Thu, 7 Jan 2021 14:06:03 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C67F5C67A for ; Thu, 7 Jan 2021 14:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610028377; 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=EA3aPIpcUdDkzw8FAJZ2Q2NP3oXbthtOWrt3EagkI80=; b=Pyv/UjuyuH4cmQwKGlqiiksxYOlRAH9+5PawUJAZD96p5YLsaNyADpXKEpXoN8FX2eRf5r PRpMdNaR38Hd+ZYMsO9BPALAIo7ULqH7GyrwUm3vypJcEoU/RUJdMgJ/vcKQ91CSDbspMO 9rHa7rqtHOeVvIv3FHa2OX+EWh6iC8c= X-MC-Unique: CZr2VEj3OzW1PngaTmWBdw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemuMonitorFdsetsFree: Don't leak @set->fds Date: Thu, 7 Jan 2021 15:05:57 +0100 Message-Id: <975c793c1420899db8f4f358341a035e1bbeb1cb.1610028357.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.11 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The @fds member of qemuMonitorFdsetInfo struct is an array and as such, it's allocated in qemuMonitorJSONQueryFdsetsParse() but not freed in qemuMonitorFdsetsFree(). Fixes: b8998cc670f7b1b11a83276050e49dce7efba333 Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 40f2997cb6..abdd9d5240 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2708,6 +2708,8 @@ void qemuMonitorFdsetsFree(qemuMonitorFdsetsPtr fdset= s) =20 for (j =3D 0; j < set->nfds; j++) g_free(set->fds[j].opaque); + + g_free(set->fds); } g_free(fdsets->fdsets); g_free(fdsets); --=20 2.26.2