diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/path.c | 4 | ||||
-rw-r--r-- | util/qemu-config.c | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/util/path.c b/util/path.c index 623219e4c5..5c59d9f1d3 100644 --- a/util/path.c +++ b/util/path.c @@ -160,7 +160,9 @@ void init_paths(const char *prefix) base = new_entry("", NULL, pref_buf); base = add_dir_maybe(base); if (base->num_entries == 0) { - free (base); + g_free(base->pathname); + free(base->name); + free(base); base = NULL; } else { set_parents(base, base); diff --git a/util/qemu-config.c b/util/qemu-config.c index bcf0b86f91..f4e4f38749 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -39,6 +39,20 @@ QemuOptsList *qemu_find_opts(const char *group) return ret; } +QemuOpts *qemu_find_opts_singleton(const char *group) +{ + QemuOptsList *list; + QemuOpts *opts; + + list = qemu_find_opts(group); + assert(list); + opts = qemu_opts_find(list, NULL); + if (!opts) { + opts = qemu_opts_create(list, NULL, 0, &error_abort); + } + return opts; +} + static CommandLineParameterInfoList *query_option_descs(const QemuOptDesc *desc) { CommandLineParameterInfoList *param_list = NULL, *entry; |