From b09417b9bcbde787a03cf38608cb897a52f12dd5 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 1 Dec 2009 15:24:18 +0100 Subject: 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 Signed-off-by: Anthony Liguori --- qemu-option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qemu-option.c') diff --git a/qemu-option.c b/qemu-option.c index 49efd392d..b00910900 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); } -- cgit v1.2.3-65-gdbad