Skip to content

Commit

Permalink
qdict: Fix memory leak in qdict_do_flatten()
Browse files Browse the repository at this point in the history
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
kevmw committed Nov 29, 2013
1 parent dce32b6 commit 6273d11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qobject/qdict.c
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit 6273d11

Please sign in to comment.