BUG/MEDIUM: listeners: Don't call fd_stop_recv() if fd_updt is NULL.

In do_unbind_listener, don't bother calling fd_stop_recv() if fd_updt is
NULL. It means it has already been free'd, and it would crash.
This commit is contained in:
Olivier Houchard 2019-03-08 15:35:42 +01:00 committed by Olivier Houchard
parent 92fce85d03
commit a51885621d

View File

@ -449,7 +449,7 @@ void dequeue_all_listeners(struct list *list)
*/ */
void do_unbind_listener(struct listener *listener, int do_close) void do_unbind_listener(struct listener *listener, int do_close)
{ {
if (listener->state == LI_READY) if (listener->state == LI_READY && fd_updt)
fd_stop_recv(listener->fd); fd_stop_recv(listener->fd);
LIST_DEL_LOCKED(&listener->wait_queue); LIST_DEL_LOCKED(&listener->wait_queue);