[libvirt PATCH v2 18/20] commandhelper: Use automatic memory management in printCwd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 tests/commandhelper.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 854f3c09bf..5f0c1f5a51 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -194,7 +194,7 @@ static void printDaemonization(FILE *log, struct Arguments *args)
 
 static int printCwd(FILE *log)
 {
-    char *cwd = NULL;
+    cleanup(char *, cleanupGeneric) cwd = NULL;
     char *display;
 
     if (!(cwd = getcwd(NULL, 0)))
@@ -213,7 +213,6 @@ static int printCwd(FILE *log)
 # endif
 
     fprintf(log, "CWD:%s\n", display);
-    free(cwd);
     return 0;
 }
 
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux