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 <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
diff --git a/qemu-option.c b/qemu-option.c
index 49efd39..b009109 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -481,7 +481,7 @@
};
struct QemuOpts {
- const char *id;
+ char *id;
QemuOptsList *list;
QTAILQ_HEAD(QemuOptHead, QemuOpt) head;
QTAILQ_ENTRY(QemuOpts) next;
@@ -686,6 +686,7 @@
qemu_opt_del(opt);
}
QTAILQ_REMOVE(&opts->list->head, opts, next);
+ qemu_free(opts->id);
qemu_free(opts);
}