From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqP2s-0003ns-Ak for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqP2i-0003gs-Qf for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:53 -0400 Received: from [199.232.76.173] (port=37808 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqP2g-0003fh-Ee for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37309) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqP2f-0001V4-IX for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:45 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8NAPi9N018458 for ; Wed, 23 Sep 2009 06:25:44 -0400 From: Mark McLoughlin Date: Wed, 23 Sep 2009 11:24:04 +0100 Message-Id: <1253701463-3134-6-git-send-email-markmc@redhat.com> In-Reply-To: <1253701463-3134-1-git-send-email-markmc@redhat.com> References: <1253701463-3134-1-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 05/24] 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 422ef4c..9a34030 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