]> xenbits.xensource.com Git - libvirt.git/commitdiff
leaseshelper: fix crash
authorPavel Hrdina <phrdina@redhat.com>
Wed, 11 Jun 2014 15:17:15 +0000 (17:17 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 11 Jun 2014 15:21:11 +0000 (17:21 +0200)
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 <phrdina@redhat.com>
src/network/leaseshelper.c

index b6f6c32b507b28e19c00497ca52fd113e92a9fe7..69081c3581eea2cc68db45601a57f0d33c8ff1d3 100644 (file)
@@ -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);