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(a)redhat.com>
---
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
Show replies by date