From: Pavel Hrdina Date: Wed, 11 Jun 2014 15:17:15 +0000 (+0200) Subject: leaseshelper: fix crash X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a93504cca4c1b95421ba360ea22a98f978bf1b2a;p=libvirt.git leaseshelper: fix crash Commit baafe668 introduced new leaseshelper with a crash of freeing env string. Calling 'getenv()' inside 'virGetEnvAllowSUID()' may return a static string and we definitely should not free it. The author probably want to free the copy of that string. Signed-off-by: Pavel Hrdina --- diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c index b6f6c32b50..69081c3581 100644 --- a/src/network/leaseshelper.c +++ b/src/network/leaseshelper.c @@ -351,7 +351,7 @@ main(int argc, char **argv) virPidFileReleasePath(pid_file, pid_file_fd); VIR_FREE(pid_file); - VIR_FREE(exptime_tmp); + VIR_FREE(exptime); VIR_FREE(custom_lease_file); virJSONValueFree(lease_new); virJSONValueFree(leases_array);