[sr-dev] git:master:23ee80c8: evapi: close server socket if fnctl() fails
Daniel-Constantin Mierla
miconda at gmail.com
Mon Jul 10 11:28:25 CEST 2017
Module: kamailio
Branch: master
Commit: 23ee80c8d71b9bac63ebe6117620cffc8900c2a9
URL: https://github.com/kamailio/kamailio/commit/23ee80c8d71b9bac63ebe6117620cffc8900c2a9
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/23ee80c8d71b9bac63ebe6117620cffc8900c2a9.diff
Patch: https://github.com/kamailio/kamailio/commit/23ee80c8d71b9bac63ebe6117620cffc8900c2a9.patch
---
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;
}
More information about the sr-dev
mailing list