From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44477 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhMeU-0001Z1-MF for qemu-devel@nongnu.org; Mon, 24 Jan 2011 08:40:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhMeT-0005xx-77 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 08:40:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhMeS-0005xs-U9 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 08:40:13 -0500 Date: Mon, 24 Jan 2011 15:39:58 +0200 From: "Michael S. Tsirkin" Message-ID: <20110124133958.GB3165@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: [PATCH] pci: memory leak of PCIDevice::rom_file List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Mon, Jan 24, 2011 at 07:00:47PM +0900, Isaku Yamahata wrote: > PCIDevice::rom_file is leaked. > PCIDevice::rom_file is allocated in pci_qdev_init(), but not freed anywhere. > free it in qemu_unregister_device(). > > Signed-off-by: Isaku Yamahata Applied, thanks. > --- > hw/pci.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index b8f5385..044c4bd 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -833,6 +833,7 @@ static int pci_unregister_device(DeviceState *dev) > > pci_unregister_io_regions(pci_dev); > pci_del_option_rom(pci_dev); > + qemu_free(pci_dev->romfile); > do_pci_unregister_device(pci_dev); > return 0; > } > -- > 1.7.1.1