Commit b0563748 by Serge Hallyn Committed by Stéphane Graber

check netnsfd before closing

parent 0fd48914
...@@ -1058,6 +1058,7 @@ int __lxc_start(const char *name, struct lxc_conf *conf, ...@@ -1058,6 +1058,7 @@ int __lxc_start(const char *name, struct lxc_conf *conf,
err = lxc_poll(name, handler); err = lxc_poll(name, handler);
if (err) { if (err) {
ERROR("mainloop exited with an error"); ERROR("mainloop exited with an error");
if (netnsfd >= 0)
close(netnsfd); close(netnsfd);
goto out_abort; goto out_abort;
} }
...@@ -1090,6 +1091,7 @@ int __lxc_start(const char *name, struct lxc_conf *conf, ...@@ -1090,6 +1091,7 @@ int __lxc_start(const char *name, struct lxc_conf *conf,
} }
lxc_rename_phys_nics_on_shutdown(netnsfd, handler->conf); lxc_rename_phys_nics_on_shutdown(netnsfd, handler->conf);
if (netnsfd >= 0)
close(netnsfd); close(netnsfd);
if (handler->pinfd >= 0) { if (handler->pinfd >= 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment