Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
httpc: hc->hc_efd might be NULL after cond_wait
  • Loading branch information
perexg committed Dec 9, 2015
1 parent c766d16 commit c618217
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/httpc.c
Expand Up @@ -1534,11 +1534,13 @@ http_client_close ( http_client_t *hc )
hc->hc_shutdown_wait = 1;
while (hc->hc_running)
pthread_cond_wait(&http_cond, &http_lock);
memset(&ev, 0, sizeof(ev));
ev.fd = hc->hc_fd;
tvhpoll_rem(hc->hc_efd, &ev, 1);
TAILQ_REMOVE(&http_clients, hc, hc_link);
hc->hc_efd = NULL;
if (hc->hc_efd) {
memset(&ev, 0, sizeof(ev));
ev.fd = hc->hc_fd;
tvhpoll_rem(hc->hc_efd, &ev, 1);
TAILQ_REMOVE(&http_clients, hc, hc_link);
hc->hc_efd = NULL;
}
pthread_mutex_unlock(&http_lock);
}
http_client_shutdown(hc, 1, 0);
Expand Down

0 comments on commit c618217

Please sign in to comment.