]> xenbits.xensource.com Git - libvirt.git/commitdiff
cputest: Avoid use of temporary variable in DO_TEST macro
authorPeter Krempa <pkrempa@redhat.com>
Thu, 11 Jun 2020 08:24:54 +0000 (10:24 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 15 Jun 2020 08:27:37 +0000 (10:27 +0200)
Use g_free directly to free the returned pointer from
virTestLogContentAndReset rather than store it in a temp variable which
was necessary when we only allowed VIR_FREE.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
tests/cputest.c

index b66ea7850e4f12c6f39eb95d9e07a48d7ec2df1c..0cf68705748b92bc6b73d5e36eb6573cbcfa8857 100644 (file)
@@ -997,10 +997,8 @@ mymain(void)
             flags, result \
         }; \
         char *testLabel; \
-        char *tmp; \
  \
-        tmp = virTestLogContentAndReset(); \
-        VIR_FREE(tmp); \
+        g_free(virTestLogContentAndReset());\
  \
         testLabel = g_strdup_printf("%s(%s): %s", #api, \
                                     virArchToString(arch), name); \