bugfix: prevent a segfault during imtcp's shutdown

If imtcp is loaded and no listeners are configured (which is uncommon),
rsyslog crashes during shutdown.

The cause is that startWorkerPool() is called unconditionally during
modExit() even if there are no listerners. Correcting this triggers a
memleak of the wrkrMut mutex which shouldn't have been destroyed in
startWorkerPool() in the first place.
This commit is contained in:
Tomas Heinrich 2013-12-09 17:59:46 +01:00 committed by Rainer Gerhards
parent 22ad2d2f0a
commit d5dead4ea0

View File

@ -1395,7 +1395,10 @@ stopWorkerPool(void)
BEGINmodExit
CODESTARTmodExit
stopWorkerPool();
if(bWrkrRunning) {
stopWorkerPool();
bWrkrRunning = 0;
}
/* de-init in reverse order! */
tcpsrvClassExit();
tcps_sessClassExit();