]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: xml: convert pointers to use g_autofree
authorBarrett Schonefeld <bschoney@utexas.edu>
Mon, 23 Nov 2020 22:09:22 +0000 (16:09 -0600)
committerJán Tomko <jtomko@redhat.com>
Tue, 24 Nov 2020 13:17:07 +0000 (14:17 +0100)
Signed-off-by: Barrett Schonefeld <bschoney@utexas.edu>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/util/virxml.c

index a3b819d85c4fde4bfa2f915cefeee4f9cf7594d3..7df50e4b4d185b2148864e4610c4ad6a8eb1d2d7 100644 (file)
@@ -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);
 }
 
 /**