Fix memory leak on exit

Only to clean up, possibly relevant for no-MMU systems, but
they have other issues as well (e.g. fork) that prevent them
from using the sysklogd project.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg 2022-05-29 16:59:50 +02:00
parent 7ff4a7d210
commit dfc32d7843
2 changed files with 6 additions and 1 deletions

View File

@ -2372,6 +2372,11 @@ void die(int signo)
flog(LOG_SYSLOG | LOG_INFO, "exiting on signal %d", signo);
}
/*
* Stop all active timers
*/
timer_exit();
/*
* Close all open log files.
*/

View File

@ -212,7 +212,7 @@ void timer_exit(void)
alarm(0);
close(timer_fd[0]);
socket_close((timer_fd[0]));
close(timer_fd[1]);
LIST_FOREACH_SAFE(tmr, &tmr_head, tmr_link, tmp) {