]> xenbits.xensource.com Git - libvirt.git/commitdiff
virPidFileConstructPath: Drop useless VIR_FREE()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Apr 2015 13:01:02 +0000 (15:01 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Apr 2015 13:01:02 +0000 (15:01 +0200)
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@redhat.com>
src/util/virpidfile.c

index a77a326506f7e3ae9146a6ab37bbb010b5acc6be..8144ff946af94a0e9ae8c8756e11481fa7c909e6 100644 (file)
@@ -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;