From nobody Mon Apr 29 12:50:38 2024 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 1506001409037601.6654843366059; Thu, 21 Sep 2017 06:43:29 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 468D52CE923; Thu, 21 Sep 2017 13:43: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 15B3361357; Thu, 21 Sep 2017 13:43:27 +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 4A8CC3FC75; Thu, 21 Sep 2017 13:43:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8LCtKNc020849 for ; Thu, 21 Sep 2017 08:55:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id B42986017B; Thu, 21 Sep 2017 12:55:20 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A9AF6047B for ; Thu, 21 Sep 2017 12:55:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 468D52CE923 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 21 Sep 2017 14:55:12 +0200 Message-Id: <74662c78ad210335a1fd6e90e5f7cece3c75962c.1505998512.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemuBuildHostNetStr: Don't leak @addr 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 21 Sep 2017 13:43:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The virSocketAddrFormat() allocates the string and it's caller responsibility to free it afterwards. =3D=3D28857=3D=3D 11 bytes in 1 blocks are definitely lost in loss record 3= 7 of 168 =3D=3D28857=3D=3D at 0x4C2BEDF: malloc (vg_replace_malloc.c:299) =3D=3D28857=3D=3D by 0x9A81D79: strdup (in /lib64/libc-2.23.so) =3D=3D28857=3D=3D by 0x5DA3BF0: virStrdup (virstring.c:902) =3D=3D28857=3D=3D by 0x5D96182: virSocketAddrFormatFull (virsocketaddr.c= :427) =3D=3D28857=3D=3D by 0x5D95E13: virSocketAddrFormat (virsocketaddr.c:352) =3D=3D28857=3D=3D by 0x5706890: qemuBuildHostNetStr (qemu_command.c:3891) =3D=3D28857=3D=3D by 0x57138D3: qemuBuildInterfaceCommandLine (qemu_comm= and.c:8597) =3D=3D28857=3D=3D by 0x5713D6A: qemuBuildNetCommandLine (qemu_command.c:= 8699) =3D=3D28857=3D=3D by 0x57176F6: qemuBuildCommandLine (qemu_command.c:100= 27) =3D=3D28857=3D=3D by 0x5769D61: qemuProcessCreatePretendCmd (qemu_proces= s.c:6004) =3D=3D28857=3D=3D by 0x4056EC: testCompareXMLToArgv (qemuxml2argvtest.c:= 502) =3D=3D28857=3D=3D by 0x41DF40: virTestRun (testutils.c:180) Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- src/qemu/qemu_command.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9b3e3fc04..abeb24846 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3900,6 +3900,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, if (ip->prefix) virBufferAsprintf(&buf, "/%u", ip->prefix); virBufferAddChar(&buf, ','); + VIR_FREE(addr); } break; =20 --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list