From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbU3t-0007Ja-8B for qemu-devel@nongnu.org; Fri, 16 Dec 2011 04:26:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbU3n-0001ol-HM for qemu-devel@nongnu.org; Fri, 16 Dec 2011 04:26:41 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:45535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbU3n-0001oU-Cs for qemu-devel@nongnu.org; Fri, 16 Dec 2011 04:26:35 -0500 Received: by eekb45 with SMTP id b45so3331239eek.4 for ; Fri, 16 Dec 2011 01:26:34 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4EEB0EC9.6030705@redhat.com> Date: Fri, 16 Dec 2011 10:26:33 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [patch] replace all strdup() with g_strdup() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Koi Cc: qemu-devel On 12/16/2011 09:07 AM, Jun Koi wrote: > This patch replaces all the strdup() with g_strdup() > > Signed-off-by: Jun Koi > > $ 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