From c64f50d1e250879611e6f328e2c4fb18c8a4ab0c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 22 Jan 2013 11:07:57 +0100 Subject: g_strdup(NULL) returns NULL; simplify Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Stefan Hajnoczi --- util/qemu-option.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'util') diff --git a/util/qemu-option.c b/util/qemu-option.c index f532b76..c12e724 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -643,9 +643,7 @@ static void opt_set(QemuOpts *opts, const char *name, const char *value, QTAILQ_INSERT_TAIL(&opts->head, opt, next); } opt->desc = desc; - if (value) { - opt->str = g_strdup(value); - } + opt->str = g_strdup(value); qemu_opt_parse(opt, &local_err); if (error_is_set(&local_err)) { error_propagate(errp, local_err); @@ -792,9 +790,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, } } opts = g_malloc0(sizeof(*opts)); - if (id) { - opts->id = g_strdup(id); - } + opts->id = g_strdup(id); opts->list = list; loc_save(&opts->loc); QTAILQ_INIT(&opts->head); -- cgit v1.1