qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()
Date: Fri, 16 Dec 2011 10:26:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 12/16/2011 09:07 AM, Jun Koi wrote:
This patch replaces all the strdup() with g_strdup()

Signed-off-by: Jun Koi<address@hidden>

$ diffstat strdup.diff
  cmd.c               |    4 ++--
  envlist.c           |    6 +++---
  exec.c              |    2 +-
  hw/isa-bus.c        |    2 +-
  hw/pc.c             |    2 +-
  hw/pci.c            |    2 +-
  hw/qdev.c           |    2 +-
  hw/scsi-bus.c       |    2 +-
  hw/sun4m.c          |    6 +++---
  hw/sun4u.c          |    2 +-
  hw/usb-msd.c        |    2 +-
  hw/virtio-blk.c     |    2 +-
  ia64-dis.c          |    2 +-
  microblaze-dis.c    |   18 +++++++++---------
  path.c              |    2 +-
  readline.c          |    2 +-
  test-qmp-commands.c |   12 ++++++------
  17 files changed, 35 insertions(+), 35 deletions(-)

You cannot do this unless you also convert all free to g_free. So you also cannot do this when you are passing strings to libraries that take ownership of the strings. A search-and-replace conversion is not possible.

Paolo



reply via email to

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