Skip to content

Commit

Permalink
evapi: close server socket if fnctl() fails
Browse files Browse the repository at this point in the history
(cherry picked from commit 23ee80c)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent 046f012 commit 273f233
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/evapi/evapi_dispatch.c
Expand Up @@ -592,10 +592,12 @@ int evapi_run_dispatcher(char *laddr, int lport)
fflags = fcntl(evapi_srv_sock, F_GETFL);
if(fflags<0) {
LM_ERR("failed to get the srv socket flags\n");
close(evapi_srv_sock);
return -1;
}
if (fcntl(evapi_srv_sock, F_SETFL, fflags | O_NONBLOCK)<0) {
LM_ERR("failed to set srv socket flags\n");
close(evapi_srv_sock);
return -1;
}

Expand Down

0 comments on commit 273f233

Please sign in to comment.