qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc
Date: Thu, 29 Sep 2016 18:10:48 +0100
User-agent: Mutt/1.7.0 (2016-08-17)

On Thu, Sep 29, 2016 at 10:27:06PM +0530, Annapoornima Koppad wrote:
> Signed-off-by: Annapoornima Koppad <address@hidden>
> ---
>  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/ :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]