From: Serge Hallyn Date: Wed, 6 Mar 2013 20:32:33 +0000 (-0600) Subject: attach: free result before potentially strduping a second time. X-Git-Tag: lxc-0.9.0.rc1~2^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53a54099bc66a8a72935220921be73b933dad064;p=thirdparty%2Flxc.git attach: free result before potentially strduping a second time. Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 6b89763cc..9ab568263 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -355,6 +355,8 @@ char *lxc_attach_getpwshell(uid_t uid) } if (!token) continue; + if (result) + free(result); result = strdup(token); /* sanity check that there are no fields after that */