From: Gleb Natapov Date: Wed, 2 Feb 2011 15:34:34 +0000 (+0200) Subject: do not pass NULL to strdup. X-Git-Tag: v0.14.0-rc1~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd08f20c23465c82c62187d463dacc6d00f79508;p=thirdparty%2Fqemu.git do not pass NULL to strdup. Also use qemu_strdup() instead of strdup() in bootindex code. Signed-off-by: Gleb Natapov Signed-off-by: Aurelien Jarno (cherry picked from commit 4fef930af8d7fab4b6c777fa4c6e2b902359262a) --- diff --git a/vl.c b/vl.c index 655617f9f36..ed2cdfae421 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); }