Module: kamailio
Branch: master
Commit: 0225f89a658172d0652e0da14549ee03653114d2
URL: https://github.com/kamailio/kamailio/commit/0225f89a658172d0652e0da14549ee0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-18T09:11:12+02:00
core: pt - check to avoid two times closing unneeded sockets
---
Modified: src/core/pt.c
---
Diff: https://github.com/kamailio/kamailio/commit/0225f89a658172d0652e0da14549ee0…
Patch: https://github.com/kamailio/kamailio/commit/0225f89a658172d0652e0da14549ee0…
---
diff --git a/src/core/pt.c b/src/core/pt.c
index 930d73093f..1944da6207 100644
--- a/src/core/pt.c
+++ b/src/core/pt.c
@@ -210,14 +210,14 @@ int close_extra_socks(int child_id, int proc_no)
/* close all listen sockets (needed only in tcp_main */
if (!tcp_disable){
for(si=tcp_listen; si; si=si->next){
- close(si->socket);
+ if(si->socket>=0) close(si->socket);
/* safe to change since this is a per process copy */
si->socket=-1;
}
#ifdef USE_TLS
if (!tls_disable){
for(si=tls_listen; si; si=si->next){
- close(si->socket);
+ if(si->socket>=0) close(si->socket);
/* safe to change since this is a per process copy */
si->socket=-1;
}