Received: from [140.186.70.92] (port=46770 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlSBd-0003dG-Sv for qemu-devel@nongnu.org; Fri, 04 Feb 2011 15:23:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlSBc-00073d-Is for qemu-devel@nongnu.org; Fri, 04 Feb 2011 15:23:21 -0500 Received: from hall.aurel32.net ([88.191.126.93]:59335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlSBc-00073Z-Cr for qemu-devel@nongnu.org; Fri, 04 Feb 2011 15:23:20 -0500 Date: Fri, 4 Feb 2011 21:23:24 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] do not pass NULL to strdup. Message-ID: <20110204202324.GG10125@volta.aurel32.net> References: <20110202153434.GP14984@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20110202153434.GP14984@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org, armbru@redhat.com On Wed, Feb 02, 2011 at 05:34:34PM +0200, Gleb Natapov wrote: > Also use qemu_strdup() instead of strdup() in bootindex code. > > Signed-off-by: Gleb Natapov > --- > > Should go to stable too. Thanks, applied > 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. > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net