From: Luiz Capitulino Date: Sat, 8 Mar 2014 17:20:06 +0000 (-0500) Subject: tests: test-qmp-commands: Fix double free X-Git-Tag: qemu-xen-4.5.0-rc1~126^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2a7a1a56d1e30de07cf7d7636a35bf7706b9500e;p=qemu-upstream-4.5-testing.git tests: test-qmp-commands: Fix double free The ret variable is freed twice, but on the second time we actually want to free ret3 instead. Don't know why this didn't explode. Reported-by: Peter Maydell Tested-by: Peter Maydell Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c index 8e62c2d8a..554e222b3 100644 --- a/tests/test-qmp-commands.c +++ b/tests/test-qmp-commands.c @@ -141,7 +141,7 @@ static void test_dispatch_cmd_io(void) ret3 = qobject_to_qint(test_qmp_dispatch(req)); assert(qint_get_int(ret3) == 66); - QDECREF(ret); + QDECREF(ret3); QDECREF(req); }