From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqP2t-0003mu-My for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqP2f-0003fQ-PG for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:50 -0400 Received: from [199.232.76.173] (port=37805 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqP2f-0003f1-AQ for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25823) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqP2e-0001Uk-Fv for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:25:44 -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 n8NAPhfd028193 for ; Wed, 23 Sep 2009 06:25:43 -0400 From: Mark McLoughlin Date: Wed, 23 Sep 2009 11:24:02 +0100 Message-Id: <1253701463-3134-4-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 03/24] Make NICInfo string fields non-const List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark McLoughlin We now only assign strdup()ed strings to these fields, never static strings. Signed-off-by: Mark McLoughlin --- net.c | 2 +- net.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net.c b/net.c index c276d0a..d04b6bd 100644 --- a/net.c +++ b/net.c @@ -2804,7 +2804,7 @@ void net_client_uninit(NICInfo *nd) nd->vlan->nb_guest_devs--; nb_nics--; nd->used = 0; - qemu_free((void *)nd->model); + qemu_free(nd->model); } static int net_host_check_device(const char *device) diff --git a/net.h b/net.h index 1479826..d48c9b8 100644 --- a/net.h +++ b/net.h @@ -94,10 +94,10 @@ enum { struct NICInfo { uint8_t macaddr[6]; - const char *model; - const char *name; - const char *devaddr; - const char *id; + char *model; + char *name; + char *devaddr; + char *id; VLANState *vlan; VLANClientState *vc; void *private; -- 1.6.2.5