From 344415a306f4076eff475f30894975d2fb993f1d Mon Sep 17 00:00:00 2001 From: Barrett Schonefeld Date: Mon, 23 Nov 2020 16:09:22 -0600 Subject: [PATCH] util: xml: convert pointers to use g_autofree MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Barrett Schonefeld Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- src/util/virxml.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index a3b819d85c..7df50e4b4d 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -696,8 +696,8 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNUSED, ...) unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ int domcode = VIR_FROM_XML; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - char *contextstr = NULL; - char *pointerstr = NULL; + g_autofree char *contextstr = NULL; + g_autofree char *pointerstr = NULL; /* conditions for error printing */ @@ -763,9 +763,6 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNUSED, ...) contextstr, pointerstr); } - - VIR_FREE(contextstr); - VIR_FREE(pointerstr); } /** -- 2.47.2