(child_main): Check to make sure memory could be allocated to handle

the child request.
(child_main_loop): Added a call to truncate_log_file() when the log
file is to be rotated.
This commit is contained in:
Robert James Kaes 2002-10-03 20:33:09 +00:00
parent ef0656db3e
commit ac881909bf

View File

@ -1,4 +1,4 @@
/* $Id: child.c,v 1.5 2002-06-27 16:29:21 rjkaes Exp $
/* $Id: child.c,v 1.6 2002-10-03 20:33:09 rjkaes Exp $
*
* Handles the creation/destruction of the various children required for
* processing incoming connections.
@ -164,8 +164,11 @@ child_main(struct child_s* ptr)
socklen_t clilen;
cliaddr = safemalloc(addrlen);
if (!cliaddr)
if (!cliaddr) {
log_message(LOG_CRIT,
"Could not allocate memory for child address.");
exit(0);
}
ptr->connects = 0;
@ -382,6 +385,8 @@ child_main_loop(void)
/* Handle log rotation if it was requested */
if (received_sighup) {
truncate_log_file();
#ifdef FILTER_ENABLE
if (config.filter) {
filter_destroy();