summaryrefslogtreecommitdiff
path: root/qemu-option.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-12-01 15:24:18 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 11:45:49 -0600
commit5f9d730577395537d18098d07414e6d76c79d549 (patch)
tree352c583c1b1958224126519fb59946df93878806 /qemu-option.c
parenta043af871f4936e4acf812db0f6f8f713106bdcf (diff)
downloadqemu-5f9d730577395537d18098d07414e6d76c79d549.tar.gz
qemu-5f9d730577395537d18098d07414e6d76c79d549.tar.bz2
qemu-5f9d730577395537d18098d07414e6d76c79d549.zip
qemu-opts: Release id on deletion
The opts id is always allocated via qemu_strdup, so it need not be const, but it has to be released on opts deletion. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-option.c')
-rw-r--r--qemu-option.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qemu-option.c b/qemu-option.c
index 49efd392d9..b009109009 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -481,7 +481,7 @@ struct QemuOpt {
};
struct QemuOpts {
- const char *id;
+ char *id;
QemuOptsList *list;
QTAILQ_HEAD(QemuOptHead, QemuOpt) head;
QTAILQ_ENTRY(QemuOpts) next;
@@ -686,6 +686,7 @@ void qemu_opts_del(QemuOpts *opts)
qemu_opt_del(opt);
}
QTAILQ_REMOVE(&opts->list->head, opts, next);
+ qemu_free(opts->id);
qemu_free(opts);
}