From f6aa116eaaae5bfd862c2c7a03975734e8a35012 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Sat, 6 Apr 2002 00:03:32 +0000 Subject: [PATCH] Added a call to apr_bucket_alloc_destroy() to the clean_child_exit() code that is called when each worker thread terminates. This stopped the memory leak. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94479 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/netware/mpm_netware.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index b3ec8ccb3a..f6b460f877 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -204,9 +204,10 @@ static int show_settings = 0; #endif /* a clean exit from a child with proper cleanup */ -static void clean_child_exit(int code, int worker_num) __attribute__ ((noreturn)); -static void clean_child_exit(int code, int worker_num) +static void clean_child_exit(int code, int worker_num, apr_bucket_alloc_t *bucket_alloc) __attribute__ ((noreturn)); +static void clean_child_exit(int code, int worker_num, apr_bucket_alloc_t *bucket_alloc) { + apr_bucket_alloc_destroy(bucket_alloc); apr_thread_mutex_lock(worker_thread_count_mutex); worker_thread_count--; apr_thread_mutex_unlock(worker_thread_count_mutex); @@ -395,7 +396,7 @@ void worker_main(void *arg) if ((ap_max_requests_per_child > 0 && requests_this_child++ >= ap_max_requests_per_child)) { - clean_child_exit(0, my_worker_num); + clean_child_exit(0, my_worker_num, bucket_alloc); } ap_update_child_status_from_indexes(0, my_worker_num, WORKER_READY, @@ -412,7 +413,7 @@ void worker_main(void *arg) if (shutdown_pending || restart_pending || (ap_scoreboard_image->servers[0][my_worker_num].status == WORKER_IDLE_KILL)) { DBPRINT1 ("\nThread slot %d is shutting down\n", my_worker_num); apr_thread_mutex_unlock(accept_mutex); - clean_child_exit(0, my_worker_num); + clean_child_exit(0, my_worker_num, bucket_alloc); } /* If we just satisfied a request on listen port x, assume that more @@ -517,12 +518,12 @@ got_listener: */ ap_log_error(APLOG_MARK, APLOG_EMERG, stat, ap_server_conf, "apr_accept: giving up."); - clean_child_exit(APEXIT_CHILDFATAL, my_worker_num); + clean_child_exit(APEXIT_CHILDFATAL, my_worker_num, bucket_alloc); default: ap_log_error(APLOG_MARK, APLOG_ERR, stat, ap_server_conf, "apr_accept: (client socket)"); - clean_child_exit(1, my_worker_num); + clean_child_exit(1, my_worker_num, bucket_alloc); } } } @@ -544,7 +545,7 @@ got_listener: } request_count++; } - clean_child_exit(0, my_worker_num); + clean_child_exit(0, my_worker_num, bucket_alloc); } -- 2.40.0