From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDVj1-0007sE-Al for qemu-devel@nongnu.org; Tue, 20 Jan 2015 05:07:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDViy-0000sb-4h for qemu-devel@nongnu.org; Tue, 20 Jan 2015 05:07:55 -0500 Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:34153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDVix-0000sR-S3 for qemu-devel@nongnu.org; Tue, 20 Jan 2015 05:07:52 -0500 Received: by mail-wg0-f46.google.com with SMTP id x13so36230727wgg.5 for ; Tue, 20 Jan 2015 02:07:50 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54BE28F3.2000107@redhat.com> Date: Tue, 20 Jan 2015 11:07:47 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1421747797-2762-1-git-send-email-armbru@redhat.com> In-Reply-To: <1421747797-2762-1-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] s390: Plug memory leak on s390_pci_generate_event() error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, frank.blaschka@de.ibm.com On 20/01/2015 10:56, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > hw/s390x/s390-pci-bus.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c > index 1201b8d..d25ac74 100644 > --- a/hw/s390x/s390-pci-bus.c > +++ b/hw/s390x/s390-pci-bus.c > @@ -187,7 +187,7 @@ S390PCIBusDevice *s390_pci_find_dev_by_fh(uint32_t fh) > static void s390_pci_generate_event(uint8_t cc, uint16_t pec, uint32_t fh, > uint32_t fid, uint64_t faddr, uint32_t e) > { > - SeiContainer *sei_cont = g_malloc0(sizeof(SeiContainer)); > + SeiContainer *sei_cont; > S390pciState *s = S390_PCI_HOST_BRIDGE( > object_resolve_path(TYPE_S390_PCI_HOST_BRIDGE, NULL)); > > @@ -195,6 +195,7 @@ static void s390_pci_generate_event(uint8_t cc, uint16_t pec, uint32_t fh, > return; > } > > + sei_cont = g_malloc0(sizeof(SeiContainer)); > sei_cont->fh = fh; > sei_cont->fid = fid; > sei_cont->cc = cc; > A patch for this had been sent already, though I prefer yours. Paolo