]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/utils.h
coverity: rundir: Fix memory leaks
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 19 Feb 2014 05:40:21 +0000 (00:40 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 19 Feb 2014 15:38:38 +0000 (10:38 -0500)
commitfd8c277753a6a1487a9e77b7d712db90dc70a3a4
tree3056539380debd37abb0f6097a33f5d5cdbfc912
parent44b9ae4b8a5732a36d3fa88f0059567c93903fab
coverity: rundir: Fix memory leaks

Since we're no longer always returning a getenv result or some defined
string, the callers should cleanup the variable after use.

As a result, change from const char* to char*, add the needed free()
everywhere and use strdup() on strings coming from getenv.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/utils.h