From: Ján Tomko Date: Mon, 7 Jul 2014 06:18:44 +0000 (+0200) Subject: Free the return value of virFileFindResource X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f1e192e92ec17f9fe979f1d30bad79f21189eef1;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git Free the return value of virFileFindResource 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 --- diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c index c67bda65b..1ca777284 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -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); diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 88fc9777d..9d8120f80 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -1068,6 +1068,9 @@ doRemoteOpen(virConnectPtr conn, VIR_FREE(pkipath); VIR_FREE(knownHostsVerify); VIR_FREE(knownHosts); +#ifndef WIN32 + VIR_FREE(daemonPath); +#endif return retcode;