[PATCH] virPidFileConstructPath: Drop useless VIR_FREE()

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

 



If a virAsprintf() within the function fails, we call VIR_FREE()
over @rundir variable and jump onto cleanup label, where it is
freed again.  It doesn't hurt, but not make much sense too.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---

Pushed as trivial.

 src/util/virpidfile.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
index a77a326..8144ff9 100644
--- a/src/util/virpidfile.c
+++ b/src/util/virpidfile.c
@@ -556,11 +556,8 @@ virPidFileConstructPath(bool privileged,
             goto cleanup;
         }
 
-        if (virAsprintf(pidfile, "%s/%s.pid", rundir, progname) < 0) {
-            VIR_FREE(rundir);
+        if (virAsprintf(pidfile, "%s/%s.pid", rundir, progname) < 0)
             goto cleanup;
-        }
-
     }
 
     ret = 0;
-- 
2.0.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]