xemu/qobject
Eric Blake ba4dba5434 json-streamer: Don't leak tokens on incomplete parse
Valgrind complained about a number of leaks in
tests/check-qobject-json:

==12657==    definitely lost: 17,247 bytes in 1,234 blocks

All of which had the same root cause: on an incomplete parse,
we were abandoning the token queue without cleaning up the
allocated data within each queue element.  Introduced in
commit 95385fe, when we switched from QList (which recursively
frees contents) to g_queue (which does not).

We don't yet require glib 2.32 with its g_queue_free_full(),
so open-code it instead.

CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1463608012-12760-1-git-send-email-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-06-30 15:24:36 +02:00
..
json-lexer.c qobject: Clean up includes 2016-02-04 17:41:30 +00:00
json-parser.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
json-streamer.c json-streamer: Don't leak tokens on incomplete parse 2016-06-30 15:24:36 +02:00
Makefile.objs qobject: Simplify QObject 2015-12-17 08:21:28 +01:00
qbool.c qobject: Clean up includes 2016-02-04 17:41:30 +00:00
qdict.c qdict: fix unbounded stack warning for qdict_array_entries 2016-05-18 15:04:26 +03:00
qfloat.c qobject: Clean up includes 2016-02-04 17:41:30 +00:00
qint.c qobject: Clean up includes 2016-02-04 17:41:30 +00:00
qjson.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
qlist.c coccinelle: Remove unnecessary variables for function return value 2016-06-20 16:38:13 +02:00
qnull.c qobject: Clean up includes 2016-02-04 17:41:30 +00:00
qobject.c qobject: Clean up includes 2016-02-04 17:41:30 +00:00
qstring.c qobject: Clean up includes 2016-02-04 17:41:30 +00:00