From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bperK-00046w-EZ for qemu-devel@nongnu.org; Thu, 29 Sep 2016 13:10:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bperF-0000ce-Kg for qemu-devel@nongnu.org; Thu, 29 Sep 2016 13:10:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bperF-0000cO-EB for qemu-devel@nongnu.org; Thu, 29 Sep 2016 13:10:53 -0400 Date: Thu, 29 Sep 2016 18:10:48 +0100 From: "Daniel P. Berrange" Message-ID: <20160929171048.GY5312@redhat.com> Reply-To: "Daniel P. Berrange" References: <1475168226-13194-1-git-send-email-annakoppad@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1475168226-13194-1-git-send-email-annakoppad@gmail.com> Subject: Re: [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Annapoornima Koppad Cc: qemu-devel@nongnu.org On Thu, Sep 29, 2016 at 10:27:06PM +0530, Annapoornima Koppad wrote: > Signed-off-by: Annapoornima Koppad > --- > block/iscsi.c | 2 +- > bsd-user/elfload.c | 12 ++++++------ > disas/libvixl/vixl/a64/disasm-a64.cc | 2 +- > disas/m68k.c | 2 +- > disas/sparc.c | 4 ++-- > hw/audio/fmopl.c | 10 +++++----- > hw/usb/redirect.c | 2 +- > include/exec/softmmu-semi.h | 4 ++-- > linux-user/elfload.c | 2 +- > linux-user/syscall.c | 2 +- > slirp/mbuf.c | 4 ++-- > slirp/sbuf.c | 2 +- > slirp/socket.c | 2 +- > slirp/tcp_subr.c | 2 +- > tests/migration/stress.c | 4 ++-- > tests/tcg/cris/check_openpf1.c | 2 +- > tests/tcg/linux-test.c | 4 ++-- > tests/tcg/test-mmap.c | 2 +- > thunk.c | 2 +- > util/compatfd.c | 2 +- > util/envlist.c | 6 +++--- > 21 files changed, 37 insertions(+), 37 deletions(-) > > diff --git a/block/iscsi.c b/block/iscsi.c > index dff548a..21cb41b 100644 > --- a/block/iscsi.c > +++ b/block/iscsi.c > @@ -963,7 +963,7 @@ static BlockAIOCB *iscsi_aio_ioctl(BlockDriverState *bs, > return NULL; > } > > - acb->task = malloc(sizeof(struct scsi_task)); > + acb->task = g_malloc(sizeof(struct scsi_task)); > if (acb->task == NULL) { > error_report("iSCSI: Failed to allocate task for scsi command. %s", > iscsi_get_error(iscsi)); For every malloc you convert to g_malloc, you must also convert the corresponding 'free' to 'g_free'. This seems missing throughout your patch. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|