]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: close userns file when done
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 22 Jan 2014 19:02:42 +0000 (13:02 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 22 Jan 2014 19:02:42 +0000 (13:02 -0600)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 55b967a8bf42842259eee1359c7ca975409165f9..4ffd9a94ae68572bb4363b8656d76ecfe20324c1 100644 (file)
@@ -1396,8 +1396,10 @@ static inline bool enter_to_ns(struct lxc_container *c) {
 
                if (setns(userns, CLONE_NEWUSER)) {
                        SYSERROR("failed to setns for CLONE_NEWUSER");
+                       close(userns);
                        goto out;
                }
+               close(userns);
        }
 
        /* Switch to new netns */