From: Serge Hallyn Date: Wed, 22 Jan 2014 18:57:53 +0000 (-0600) Subject: coverity: close netns file when done X-Git-Tag: lxc-1.0.0.beta3~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32f4b9c77cd6811eb990e408f75fd9ed0c5cac4e;p=thirdparty%2Flxc.git coverity: close netns file when done Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 37239979a..55b967a8b 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1413,8 +1413,10 @@ static inline bool enter_to_ns(struct lxc_container *c) { if (setns(netns, CLONE_NEWNET)) { SYSERROR("failed to setns for CLONE_NEWNET"); + close(netns); goto out; } + close(netns); return true; out: return false;