1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Fix of shutdown: premature log cleanup led to use-after-free

This commit is contained in:
Maria Matejka
2021-12-01 10:46:49 +01:00
parent bb63e99d78
commit 55ee9961e0
3 changed files with 21 additions and 5 deletions

View File

@@ -202,7 +202,9 @@ sysdep_preconfig(struct config *c)
int
sysdep_commit(struct config *new, struct config *old UNUSED)
{
log_switch(0, &new->logfiles, new->syslog_name);
if (!new->shutdown)
log_switch(0, &new->logfiles, new->syslog_name);
return 0;
}
@@ -613,6 +615,7 @@ sysdep_shutdown_done(void)
unlink_pid_file();
unlink(path_control_socket);
log_msg(L_FATAL "Shutdown completed");
log_cleanup(1);
exit(0);
}