From nobody Sun May 5 16:11:16 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 ARC-Seal: i=1; a=rsa-sha256; t=1568275495; cv=none; d=zoho.com; s=zohoarc; b=gIWyMlcfm+QLsMDmp5//KetV2hP/2koyy12az4Crk7BHdP51fiyCpmqUdpv16X7GfEAv+WqcHWAIgJFRdpYJlsP45rXC+VNZasM1vciC/uQpxLrKOjwcs7aB2IrwqD/6Z8VqKk63N7S/L9Yq3x0LiOhHhEx4LSZCRajKGFZpgSk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568275495; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=nIciAQ3CSely76R8Ey8g6tKTpCkezuFGXr9bq5rg/4I=; b=Ik4BU55lDdLHeRzzGVuZWGCqqLhBLOssjS9b2m0LOFfpL72R9DvEsIfXd7Ew1JeYnn0g/7soFSEd7HebNkNZwhd0RIGcsj6csTIorA+D+SwE/73sM4PUDW4TuTomq8LK4JpO2ER/9NfFBK310EJqsbki9NSPBmmAQLYjV1DTLEk= ARC-Authentication-Results: i=1; mx.zoho.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 1568275495296763.9529584766609; Thu, 12 Sep 2019 01:04:55 -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 C91982A09A3; Thu, 12 Sep 2019 08:04:51 +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 86151600C4; Thu, 12 Sep 2019 08:04:50 +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 343AB2551C; Thu, 12 Sep 2019 08:04:47 +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 x8C84hEW024017 for ; Thu, 12 Sep 2019 04:04:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id E44315C22F; Thu, 12 Sep 2019 08:04:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF55E5C22C for ; Thu, 12 Sep 2019 08:04:41 +0000 (UTC) Received: from mxct.zte.com.cn (mx7.zte.com.cn [202.103.147.169]) (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 EBB33C04FFE0 for ; Thu, 12 Sep 2019 08:04:38 +0000 (UTC) Received: from mse-fl2.zte.com.cn (unknown [10.30.14.239]) by Forcepoint Email with ESMTPS id 07DF15212A7425EDC6CD for ; Thu, 12 Sep 2019 16:04:36 +0800 (CST) Received: from notes_smtp.zte.com.cn (notessmtp.zte.com.cn [10.30.1.239]) by mse-fl2.zte.com.cn with ESMTP id x8C84PIj013637 for ; Thu, 12 Sep 2019 16:04:25 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019091216045336-3553241 ; Thu, 12 Sep 2019 16:04:53 +0800 From: Yi Wang To: libvir-list@redhat.com Date: Thu, 12 Sep 2019 16:05:39 +0800 Message-Id: <1568275539-15079-1-git-send-email-wang.yi59@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-09-12 16:04:53, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-09-12 16:04:29, Serialize complete at 2019-09-12 16:04:29 X-MAIL: mse-fl2.zte.com.cn x8C84PIj013637 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 12 Sep 2019 08:04:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 12 Sep 2019 08:04:40 +0000 (UTC) for IP:'202.103.147.169' DOMAIN:'mx7.zte.com.cn' HELO:'mxct.zte.com.cn' FROM:'wang.yi59@zte.com.cn' RCPT:'' X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED, SPF_HELO_NONE, SPF_PASS) 202.103.147.169 mx7.zte.com.cn 202.103.147.169 mx7.zte.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: wang.yi59@zte.com.cn, Jiang Kun , wang.liang82@zte.com.cn, xue.zhihong@zte.com.cn Subject: [libvirt] [PATCH] fix memleak in virNodeDeviceGetPCISRIOVCaps 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.38]); Thu, 12 Sep 2019 08:04:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Jiang Kun it always alloc new memory when get dumpxml of pf device,but never free it. Now free the old first,then alloc new memory. Signed-off-by: Jiang kun Reviewed-by: Michal Privoznik and pushed. --- src/conf/node_device_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index e51371d..618ce8e 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -2509,6 +2509,7 @@ virNodeDeviceGetPCISRIOVCaps(const char *sysfsPath, for (i =3D 0; i < pci_dev->num_virtual_functions; i++) VIR_FREE(pci_dev->virtual_functions[i]); VIR_FREE(pci_dev->virtual_functions); + VIR_FREE(pci_dev->physical_function); pci_dev->num_virtual_functions =3D 0; pci_dev->max_virtual_functions =3D 0; pci_dev->flags &=3D ~VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION; --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list