[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] qemu-opts: Release id on deletion
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH] qemu-opts: Release id on deletion |
Date: |
Tue, 01 Dec 2009 15:24:18 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
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 <address@hidden>
---
qemu-option.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
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 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);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH] qemu-opts: Release id on deletion,
Jan Kiszka <=