From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGTev-0002v0-Qb for qemu-devel@nongnu.org; Wed, 28 Jan 2015 09:32:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGTen-0005Ya-AF for qemu-devel@nongnu.org; Wed, 28 Jan 2015 09:31:57 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:42591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGTen-0005Xw-0V for qemu-devel@nongnu.org; Wed, 28 Jan 2015 09:31:49 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Jan 2015 14:31:45 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id B431A219005F for ; Wed, 28 Jan 2015 14:31:40 +0000 (GMT) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t0SEVhcS58982560 for ; Wed, 28 Jan 2015 14:31:43 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t0S9Raer029034 for ; Wed, 28 Jan 2015 04:27:36 -0500 From: Cornelia Huck Date: Wed, 28 Jan 2015 15:31:30 +0100 Message-Id: <1422455498-889-2-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1422455498-889-1-git-send-email-cornelia.huck@de.ibm.com> References: <1422455498-889-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 1/9] s390: Plug memory leak on s390_pci_generate_event() error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, Markus Armbruster From: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Cornelia Huck --- 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; -- 1.7.9.5