From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48793 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pkej8-0000HL-Mo for qemu-devel@nongnu.org; Wed, 02 Feb 2011 10:34:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pkej7-0003zF-E8 for qemu-devel@nongnu.org; Wed, 02 Feb 2011 10:34:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pkej7-0003zA-4V for qemu-devel@nongnu.org; Wed, 02 Feb 2011 10:34:37 -0500 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 p12FYa2V004660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Feb 2011 10:34:36 -0500 Date: Wed, 2 Feb 2011 17:34:34 +0200 From: Gleb Natapov Message-ID: <20110202153434.GP14984@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] do not pass NULL to strdup. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com Also use qemu_strdup() instead of strdup() in bootindex code. Signed-off-by: Gleb Natapov --- Should go to stable too. diff --git a/vl.c b/vl.c index 655617f..ed2cdfa 100644 --- a/vl.c +++ b/vl.c @@ -738,7 +738,7 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev, node = qemu_mallocz(sizeof(FWBootEntry)); node->bootindex = bootindex; - node->suffix = strdup(suffix); + node->suffix = suffix ? qemu_strdup(suffix) : NULL; node->dev = dev; QTAILQ_FOREACH(i, &fw_boot_order, link) { @@ -785,7 +785,7 @@ char *get_boot_devices_list(uint32_t *size) } else if (devpath) { bootpath = devpath; } else { - bootpath = strdup(i->suffix); + bootpath = qemu_strdup(i->suffix); assert(bootpath); } -- Gleb.