From: Christian Seiler Date: Sun, 18 Aug 2013 22:52:41 +0000 (+0200) Subject: attach: Fix minor memory leak in environment variable handling X-Git-Tag: lxc-1.0.0.alpha1~1^2~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9cab7e39b101b89470e2e4109c14e7f17218032;p=thirdparty%2Flxc.git attach: Fix minor memory leak in environment variable handling Signed-off-by: Christian Seiler Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 67eb0c7ad..97dd9186c 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -295,7 +295,13 @@ int lxc_attach_set_environment(enum lxc_attach_env_policy_t policy, char** extra } if (clearenv()) { + char **p; SYSERROR("failed to clear environment"); + if (extra_keep_store) { + for (p = extra_keep_store; *p; p++) + free(*p); + free(extra_keep_store); + } return -1; }