qga: process_event() simplification and leak fix
commitae7da1e5f658ea21d96e565514de20ff2cf24fa1
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 19 Jul 2018 18:40:59 +0000 (19 20:40 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 23 Jul 2018 23:54:26 +0000 (23 18:54 -0500)
treeca868947a0261a2760017d0f3c2333c95b4b5b58
parentc5840b905e3e471833b277a27910f577d0e30d59
qga: process_event() simplification and leak fix

json_parser_parse_err() may return something else than a QDict, in
which case we loose the object. Let's keep track of the original
object to avoid leaks.

When an error occurs, "qdict" contains the response, but we still
check the "execute" key there. Untangle a bit this code, by having a
clear error path.

CC: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/main.c