From: Michal Privoznik Date: Wed, 15 Apr 2015 13:01:02 +0000 (+0200) Subject: virPidFileConstructPath: Drop useless VIR_FREE() X-Git-Tag: v1.2.15-rc1~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6515f3df94016031211d01cc7610d7208b86b788;p=thirdparty%2Flibvirt.git virPidFileConstructPath: Drop useless VIR_FREE() 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 --- diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index a77a326506..8144ff946a 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;