qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-opts: Release id on deletion
@ 2009-12-01 14:24 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2009-12-01 14:24 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

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>
---

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-01 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 14:24 [Qemu-devel] [PATCH] qemu-opts: Release id on deletion Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).