]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Free the return value of virFileFindResource
authorJán Tomko <jtomko@redhat.com>
Mon, 7 Jul 2014 06:18:44 +0000 (08:18 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 7 Jul 2014 06:32:11 +0000 (08:32 +0200)
Commits e18a80a and 57e5c3c switched from a getenv wrapper which
does not allocate a string to virFileFindResource which does not,
without freeing it.

https://bugzilla.redhat.com/show_bug.cgi?id=1116427

src/locking/lock_driver_lockd.c
src/remote/remote_driver.c

index c67bda65bcb0a98bb7636fac4bd5285c5fa41bd2..1ca777284e97d44c547df9bad6d1f7dd1d09d799 100644 (file)
@@ -273,11 +273,13 @@ static virNetClientPtr virLockManagerLockDaemonConnectionNew(bool privileged,
     if (virNetClientAddProgram(client, *prog) < 0)
         goto error;
 
+    VIR_FREE(daemonPath);
     VIR_FREE(lockdpath);
 
     return client;
 
  error:
+    VIR_FREE(daemonPath);
     VIR_FREE(lockdpath);
     virNetClientClose(client);
     virObjectUnref(client);
index 88fc9777d270e247f3382d7c62aeacc0df919203..9d8120f80313937d57a85c042cc743c638433e98 100644 (file)
@@ -1068,6 +1068,9 @@ doRemoteOpen(virConnectPtr conn,
     VIR_FREE(pkipath);
     VIR_FREE(knownHostsVerify);
     VIR_FREE(knownHosts);
+#ifndef WIN32
+    VIR_FREE(daemonPath);
+#endif
 
     return retcode;