Skip to content

Commit

Permalink
fd: only add valid fd to mainloop
Browse files Browse the repository at this point in the history
Signed-off-by: dongxinhua <dongxinhua@huawei.com>
  • Loading branch information
xinhua9569 authored and Christian Brauner committed Jan 8, 2020
1 parent c2c87fe commit 619670b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lxc/mainloop.c
Expand Up @@ -65,6 +65,8 @@ int lxc_mainloop_add_handler(struct lxc_epoll_descr *descr, int fd,
struct epoll_event ev;
struct mainloop_handler *handler;
struct lxc_list *item;
if (fd < 0)
return -1;

handler = malloc(sizeof(*handler));
if (!handler)
Expand Down

0 comments on commit 619670b

Please sign in to comment.