start: don't call close on invalid file descriptor

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-02-16 23:18:54 +01:00
parent 586b1ce72b
commit 0d0d365516
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -628,7 +628,7 @@ void lxc_free_handler(struct lxc_handler *handler)
lxc_put_nsfds(handler);
if (handler->conf && handler->conf->reboot == 0)
if (handler->conf->maincmd_fd)
if (handler->conf->maincmd_fd >= 0)
close(handler->conf->maincmd_fd);
if (handler->state_socket_pair[0] >= 0)