From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, lersek@redhat.com, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] qdict: Fix memory leak in qdict_do_flatten()
Date: Wed, 20 Nov 2013 13:09:20 +0100 [thread overview]
Message-ID: <1384949361-19143-2-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1384949361-19143-1-git-send-email-kwolf@redhat.com>
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
qobject/qdict.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 0f3e0a6..60d6cd5 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);
--
1.8.1.4
next prev parent reply other threads:[~2013-11-20 12:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 12:09 [Qemu-devel] [PATCH 0/2] qdict_flatten() fixes Kevin Wolf
2013-11-20 12:09 ` Kevin Wolf [this message]
2013-11-20 12:09 ` [Qemu-devel] [PATCH 2/2] qdict: Optimise qdict_do_flatten() Kevin Wolf
2013-11-20 12:35 ` [Qemu-devel] [PATCH 0/2] qdict_flatten() fixes Laszlo Ersek
2013-11-20 15:53 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384949361-19143-2-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).