Module: kamailio
Branch: master
Commit: 23ee80c8d71b9bac63ebe6117620cffc8900c2a9
URL:
https://github.com/kamailio/kamailio/commit/23ee80c8d71b9bac63ebe6117620cff…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-10T11:28:10+02:00
evapi: close server socket if fnctl() fails
---
Modified: src/modules/evapi/evapi_dispatch.c
---
Diff:
https://github.com/kamailio/kamailio/commit/23ee80c8d71b9bac63ebe6117620cff…
Patch:
https://github.com/kamailio/kamailio/commit/23ee80c8d71b9bac63ebe6117620cff…
---
diff --git a/src/modules/evapi/evapi_dispatch.c b/src/modules/evapi/evapi_dispatch.c
index aa07a8eb4b..04eab30e50 100644
--- a/src/modules/evapi/evapi_dispatch.c
+++ b/src/modules/evapi/evapi_dispatch.c
@@ -623,10 +623,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;
}