[PATCH 10/30] util: convert pointers to use g_autofree

Ryan Gahagan rgahagan at cs.utexas.edu
Mon Nov 23 22:09:31 UTC 2020


From: Barrett Schonefeld <bschoney at utexas.edu>

- src/util/virrotatingfile.c

Signed-off-by: Barrett Schonefeld <bschoney at utexas.edu>
---
 src/util/virrotatingfile.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c
index 9f1ef17c3e..6d8076e7c4 100644
--- a/src/util/virrotatingfile.c
+++ b/src/util/virrotatingfile.c
@@ -362,8 +362,8 @@ static int
 virRotatingFileWriterRollover(virRotatingFileWriterPtr file)
 {
     size_t i;
-    char *nextpath = NULL;
-    char *thispath = NULL;
+    g_autofree char *nextpath = NULL;
+    g_autofree char *thispath = NULL;
     int ret = -1;
 
     VIR_DEBUG("Rollover %s", file->basepath);
@@ -403,8 +403,6 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file)
 
     ret = 0;
  cleanup:
-    VIR_FREE(nextpath);
-    VIR_FREE(thispath);
     return ret;
 }
 
-- 
2.29.0




More information about the libvir-list mailing list