sim-card
/
qemu
Archived
10
0
Fork 0

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>
This commit is contained in:
Jan Kiszka 2009-12-01 15:24:18 +01:00 committed by Anthony Liguori
parent 90697be889
commit b09417b9bc
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}