From nobody Mon Feb 9 15:19:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529934574570473.96042799736495; Mon, 25 Jun 2018 06:49:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A8C4308A956; Mon, 25 Jun 2018 13:49:27 +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 631251001F55; Mon, 25 Jun 2018 13:49:26 +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 E7C7324F56; Mon, 25 Jun 2018 13:49:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5PDnNJ8004488 for ; Mon, 25 Jun 2018 09:49:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3D0CC7574E; Mon, 25 Jun 2018 13:49:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3359F75749 for ; Mon, 25 Jun 2018 13:49:22 +0000 (UTC) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8EC7887628 for ; Mon, 25 Jun 2018 13:49:21 +0000 (UTC) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 48EE03A70FC84 for ; Mon, 25 Jun 2018 21:49:02 +0800 (CST) Received: from HGHY1w002515742.local (10.177.25.93) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Mon, 25 Jun 2018 21:48:50 +0800 Date: Mon, 25 Jun 2018 21:48:50 +0800 From: w00251574 To: Message-ID: MIME-Version: 1.0 X-Originating-IP: [10.177.25.93] X-CFilter-Loop: Reflected X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 25 Jun 2018 13:49:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 25 Jun 2018 13:49:21 +0000 (UTC) for IP:'45.249.212.191' DOMAIN:'szxga05-in.huawei.com' HELO:'huawei.com' FROM:'wangjie88@huawei.com' RCPT:'' X-RedHat-Spam-Score: -0.012 (RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS) 45.249.212.191 szxga05-in.huawei.com 45.249.212.191 szxga05-in.huawei.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id w5PDnNJ8004488 X-loop: libvir-list@redhat.com Cc: eric.fangyi@huawei.com, wu.wubin@huawei.com, wangjie88@huawei.com Subject: [libvirt] [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart() 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 25 Jun 2018 13:49:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Subject: [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServer= Start() Exiting early through the return path did result in 'port_str' being leaked. Signed-off-by: Jie Wang --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index aa89ea7056..3e90279b71 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6540,7 +6540,7 @@ qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, return ret; =20 if (!(addr =3D qemuMonitorJSONBuildInetSocketAddress(host, port_str))) - return ret; + goto cleanup; =20 if (!(cmd =3D qemuMonitorJSONMakeCommand("nbd-server-start", "a:addr", &addr, --=20 2.15.0.windows.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list