Commit 4fef930a authored by Gleb Natapov's avatar Gleb Natapov Committed by Aurelien Jarno
Browse files

do not pass NULL to strdup.



Also use qemu_strdup() instead of strdup() in bootindex code.
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
parent 72902672
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment