Use g_free directly to free the returned pointer from
virTestLogContentAndReset rather than store it in a temp variable.

Signed-off-by: Peter Krempa <[email protected]>
---
 tests/cputest.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/cputest.c b/tests/cputest.c
index b66ea7850e..0cf6870574 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -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); \
-- 
2.26.2

Reply via email to