[PATCH] driver.c: Use g_autofree

Seeteena Thoufeek posted 1 patch 4 years, 1 month ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1586782137-32658-1-git-send-email-s1seetee@linux.vnet.ibm.com
src/driver.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] driver.c: Use g_autofree
Posted by Seeteena Thoufeek 4 years, 1 month ago
This is the only instance of g_autofree change applicable for
driver.c

Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
---
 src/driver.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/driver.c b/src/driver.c
index a2047be..e745210 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -48,7 +48,7 @@ virDriverLoadModule(const char *name,
                     const char *regfunc,
                     bool required)
 {
-    char *modfile = NULL;
+    g_autofree char *modfile = NULL;
     int ret;
 
     VIR_DEBUG("Module load %s", name);
@@ -62,9 +62,6 @@ virDriverLoadModule(const char *name,
         return -1;
 
     ret = virModuleLoad(modfile, regfunc, required);
-
-    VIR_FREE(modfile);
-
     return ret;
 }
 
-- 
1.8.3.1


Re: [PATCH] driver.c: Use g_autofree
Posted by Erik Skultety 4 years, 1 month ago
On Mon, Apr 13, 2020 at 06:18:57PM +0530, Seeteena Thoufeek wrote:
> This is the only instance of g_autofree change applicable for
> driver.c

I'd say something like: "This is the last missing g_autofree change to convert
the module after commit 1e2ae2e311c took care of the VIR_AUTOFREE conversion".

Reviewed-by: Erik Skultety <eskultet@redhat.com>

I'll merge this with the adjusted commit message.