From 58ebb895ffd5e29848b294a5ff155bd09dc8c3d3 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 1 Dec 2021 09:28:08 +0100 Subject: [PATCH] tests/virnetdaemontest.c: testExecRestart: Automatically free virJSONValue-s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/virnetdaemontest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 70af1480df..24f4761bb7 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -273,8 +273,8 @@ static int testExecRestart(const void *opaque) g_autofree char *outfile = NULL; g_autofree char *injsonstr = NULL; g_autofree char *outjsonstr = NULL; - virJSONValue *injson = NULL; - virJSONValue *outjson = NULL; + g_autoptr(virJSONValue) injson = NULL; + g_autoptr(virJSONValue) outjson = NULL; int fdclient[2] = { -1, -1 }, fdserver[2] = { -1, -1 }; if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) { @@ -351,8 +351,6 @@ static int testExecRestart(const void *opaque) VIR_TEST_DEBUG("Test should have failed"); ret = -1; } - virJSONValueFree(injson); - virJSONValueFree(outjson); virObjectUnref(dmn); VIR_FORCE_CLOSE(fdserver[0]); VIR_FORCE_CLOSE(fdserver[1]);