]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: free result before potentially strduping a second time.
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 6 Mar 2013 20:32:33 +0000 (14:32 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 6 Mar 2013 20:32:33 +0000 (14:32 -0600)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/attach.c

index 6b89763ccb2b456f332bda4448da79b5b155a214..9ab56826375b52947ed5057b3d64dc9afbefc442 100644 (file)
@@ -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 */