qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Annapoornima Koppad <annakoppad@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc
Date: Thu, 29 Sep 2016 18:10:48 +0100	[thread overview]
Message-ID: <20160929171048.GY5312@redhat.com> (raw)
In-Reply-To: <1475168226-13194-1-git-send-email-annakoppad@gmail.com>

On Thu, Sep 29, 2016 at 10:27:06PM +0530, Annapoornima Koppad wrote:
> Signed-off-by: Annapoornima Koppad <annakoppad@gmail.com>
> ---
>  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	other threads:[~2016-09-29 17:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 16:57 [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc Annapoornima Koppad
2016-09-29 17:10 ` Daniel P. Berrange [this message]
2016-09-29 18:07   ` Paolo Bonzini
2016-09-29 17:15 ` no-reply
2016-09-29 17:16 ` no-reply
2016-09-29 17:24 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160929171048.GY5312@redhat.com \
    --to=berrange@redhat.com \
    --cc=annakoppad@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).