From nobody Sun Apr 28 20:58:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521442049730637.7182672715804; Sun, 18 Mar 2018 23:47:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1834E80F6C; Mon, 19 Mar 2018 06:47: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 7CFF760927; Mon, 19 Mar 2018 06:47:24 +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 38D7F4CA98; Mon, 19 Mar 2018 06:47:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2J6lGPR025354 for ; Mon, 19 Mar 2018 02:47:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id EE512200BCAE; Mon, 19 Mar 2018 06:47:15 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-56.brq.redhat.com [10.40.204.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81CD42026990 for ; Mon, 19 Mar 2018 06:47:15 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 19 Mar 2018 07:47:08 +0100 Message-Id: <1c28ca19fe4002a2359e890277ce03fa6461175b.1521442028.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virNetlinkDumpCommand: Don't leak response buffer 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 19 Mar 2018 06:47:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" =3D=3D16451=3D=3D 32,768 bytes in 2 blocks are definitely lost in loss reco= rd 1,007 of 1,013 =3D=3D16451=3D=3D at 0x4C2AF0F: malloc (vg_replace_malloc.c:299) =3D=3D16451=3D=3D by 0x7CADB40: nl_recv (in /usr/lib64/libnl-3.so.200.23= .0) =3D=3D16451=3D=3D by 0x532DFAC: virNetlinkDumpCommand (virnetlink.c:363) =3D=3D16451=3D=3D by 0x53236AE: virNetDevIPCheckIPv6Forwarding (virnetde= vip.c:641) =3D=3D16451=3D=3D by 0xE3E4A1A: networkStartNetworkVirtual (bridge_drive= r.c:2490) =3D=3D16451=3D=3D by 0xE3E55F5: networkStartNetwork (bridge_driver.c:283= 2) =3D=3D16451=3D=3D by 0xE3DFFE5: networkAutostartConfig (bridge_driver.c:= 531) =3D=3D16451=3D=3D by 0x53F47E0: virNetworkObjListForEachHelper (virnetwo= rkobj.c:1412) =3D=3D16451=3D=3D by 0x52FE69F: virHashForEach (virhash.c:606) =3D=3D16451=3D=3D by 0x53F4857: virNetworkObjListForEach (virnetworkobj.= c:1439) =3D=3D16451=3D=3D by 0xE3E0BF4: networkStateAutoStart (bridge_driver.c:8= 08) =3D=3D16451=3D=3D by 0x55689CE: virStateInitialize (libvirt.c:758) Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/util/virnetlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 0e281b06b8..955f1558ee 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -360,6 +360,7 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg, goto cleanup; =20 while (!end) { + VIR_FREE(resp); len =3D nl_recv(nlhandle, &nladdr, (unsigned char **)&resp, NULL); VIR_WARNINGS_NO_CAST_ALIGN for (msg =3D resp; NLMSG_OK(msg, len); msg =3D NLMSG_NEXT(msg, len= )) { @@ -378,6 +379,7 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg, ret =3D 0; =20 cleanup: + VIR_FREE(resp); virNetlinkFree(nlhandle); return ret; } --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list