diff options
author | Kevin Wolf <kwolf@redhat.com> | 2013-11-20 13:09:20 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-11-29 13:40:37 +0100 |
commit | 6273d1136af913aaf4badc4545ccf942557c747b (patch) | |
tree | 7d553b076edf146414609a5294e042a58c5af0bb /qobject/qdict.c | |
parent | dce32b6c2bfd5132c433638352eea6f7707caf9c (diff) | |
download | qemu-6273d1136af913aaf4badc4545ccf942557c747b.tar.gz qemu-6273d1136af913aaf4badc4545ccf942557c747b.tar.bz2 qemu-6273d1136af913aaf4badc4545ccf942557c747b.zip |
qdict: Fix memory leak in qdict_do_flatten()
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qobject/qdict.c')
-rw-r--r-- | qobject/qdict.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qobject/qdict.c b/qobject/qdict.c index 0f3e0a6c81..60d6cd5a0e 100644 --- a/qobject/qdict.c +++ b/qobject/qdict.c @@ -481,7 +481,7 @@ static void qdict_do_flatten(QDict *qdict, QDict *target, const char *prefix) { QObject *value; const QDictEntry *entry, *next; - const char *new_key; + char *new_key; bool delete; entry = qdict_first(qdict); @@ -506,6 +506,8 @@ static void qdict_do_flatten(QDict *qdict, QDict *target, const char *prefix) delete = true; } + g_free(new_key); + if (delete) { qdict_del(qdict, entry->key); |