From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mv84K-0006tz-7d for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:19:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mv84E-0006py-1w for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:18:59 -0400 Received: from [199.232.76.173] (port=40398 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mv84D-0006pK-48 for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:18:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40608) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mv84C-0007s2-Lr for qemu-devel@nongnu.org; Tue, 06 Oct 2009 07:18:52 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n96BIpBx017672 for ; Tue, 6 Oct 2009 07:18:52 -0400 From: Mark McLoughlin Date: Tue, 6 Oct 2009 12:16:55 +0100 Message-Id: <1254827836-11021-6-git-send-email-markmc@redhat.com> In-Reply-To: <1254827783.2720.42.camel@blaa> References: <1254827783.2720.42.camel@blaa> Subject: [Qemu-devel] [PATCH] Use qemu_strdup() for VLANClientState string fields List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark McLoughlin Signed-off-by: Mark McLoughlin --- net.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/net.c b/net.c index f2b472d..0e5afa9 100644 --- a/net.c +++ b/net.c @@ -296,7 +296,7 @@ static char *assign_name(VLANClientState *vc1, const char *model) snprintf(buf, sizeof(buf), "%s.%d", model, id); - return strdup(buf); + return qemu_strdup(buf); } VLANClientState *qemu_new_vlan_client(VLANState *vlan, @@ -310,9 +310,9 @@ VLANClientState *qemu_new_vlan_client(VLANState *vlan, { VLANClientState *vc, **pvc; vc = qemu_mallocz(sizeof(VLANClientState)); - vc->model = strdup(model); + vc->model = qemu_strdup(model); if (name) - vc->name = strdup(name); + vc->name = qemu_strdup(name); else vc->name = assign_name(vc, model); vc->can_receive = can_receive; @@ -340,8 +340,8 @@ void qemu_del_vlan_client(VLANClientState *vc) if (vc->cleanup) { vc->cleanup(vc); } - free(vc->name); - free(vc->model); + qemu_free(vc->name); + qemu_free(vc->model); qemu_free(vc); break; } else @@ -2127,8 +2127,8 @@ static int net_socket_listen_init(VLANState *vlan, return -1; } s->vlan = vlan; - s->model = strdup(model); - s->name = name ? strdup(name) : NULL; + s->model = qemu_strdup(model); + s->name = name ? qemu_strdup(name) : NULL; s->fd = fd; qemu_set_fd_handler(fd, net_socket_accept, NULL, s); return 0; -- 1.6.2.5