summaryrefslogtreecommitdiff
path: root/tcpsrv.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-06-21 16:22:10 +0200
committerMichael Biebl <biebl@debian.org>2011-06-21 16:22:10 +0200
commitd5294b644649f563f4aa77735ebc6db6ee1776de (patch)
tree3b0e2e3d70374573ee2ed7fe03cd84fc499f2d46 /tcpsrv.c
parent734f0031f3366c83552de8b0e628949d47ff9487 (diff)
downloadrsyslog-d5294b644649f563f4aa77735ebc6db6ee1776de.tar.gz
Imported Upstream version 5.8.2upstream/5.8.2
Diffstat (limited to 'tcpsrv.c')
-rw-r--r--tcpsrv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tcpsrv.c b/tcpsrv.c
index 9972a13..0b82251 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -556,6 +556,7 @@ RunSelect(tcpsrv_t *pThis)
int bIsReady;
tcps_sess_t *pNewSess;
nssel_t *pSel = NULL;
+ rsRetVal localRet;
ISOBJ_TYPE_assert(pThis, tcpsrv);
@@ -604,8 +605,8 @@ RunSelect(tcpsrv_t *pThis)
while(nfds && iTCPSess != -1) {
if(glbl.GetGlobalInputTermState() == 1)
ABORT_FINALIZE(RS_RET_FORCE_TERM);
- CHKiRet(nssel.IsReady(pSel, pThis->pSessions[iTCPSess]->pStrm, NSDSEL_RD, &bIsReady, &nfds));
- if(bIsReady) {
+ localRet = nssel.IsReady(pSel, pThis->pSessions[iTCPSess]->pStrm, NSDSEL_RD, &bIsReady, &nfds);
+ if(bIsReady || localRet != RS_RET_OK) {
doReceive(pThis, &pThis->pSessions[iTCPSess], NULL);
--nfds; /* indicate we have processed one */
}
@@ -618,7 +619,9 @@ finalize_it: /* this is a very special case - this time only we do not exit the
* crashed, which made sense (the rest of the engine was not prepared for
* that) -- rgerhards, 2008-05-19
*/
- /*EMPTY*/;
+ if(pSel != NULL) { /* cleanup missing? happens during err exit! */
+ nssel.Destruct(&pSel);
+ }
}
/* note that this point is usually not reached */