[PATCH 1/5] vbox: Use g_autofree in tryLoadOne()

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

 



Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/vbox/vbox_XPCOMCGlue.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c
index 688211d122..e625492173 100644
--- a/src/vbox/vbox_XPCOMCGlue.c
+++ b/src/vbox/vbox_XPCOMCGlue.c
@@ -78,7 +78,7 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing,
            unsigned int *version)
 {
     int result = -1;
-    char *name = NULL;
+    g_autofree char *name = NULL;
     PFNVBOXGETXPCOMCFUNCTIONS pfnGetFunctions;
 
     if (dir != NULL) {
@@ -88,7 +88,6 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing,
             if (!ignoreMissing)
                 VIR_ERROR(_("Library '%1$s' doesn't exist"), name);
 
-            VIR_FREE(name);
             return -1;
         }
     } else {
@@ -152,8 +151,6 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing,
         g_clear_pointer(&hVBoxXPCOMC, dlclose);
     }
 
-    VIR_FREE(name);
-
     return result;
 }
 
-- 
2.45.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