tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgo...@apache.org
Subject cvs commit: jakarta-tomcat/src/native/mod_jk/common jk_ajp13_worker.c
Date Fri, 01 Jun 2001 08:41:16 GMT
hgomez      01/06/01 01:41:16

  Modified:    src/native/mod_jk/apache1.3 mod_jk.c
               src/native/mod_jk/common jk_ajp13_worker.c
  Log:
  Fix memory leaks when multiple conf structures are allocated
  and not desallocated
  Submitted by:	Mike Anderson <mmanders@novell.com>
  
  Revision  Changes    Path
  1.9       +19 -7     jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_jk.c	2001/04/05 05:27:52	1.8
  +++ mod_jk.c	2001/06/01 08:41:13	1.9
  @@ -1047,14 +1047,26 @@
   
   static void exit_handler (server_rec *s, ap_pool *p)
   {
  -   jk_server_conf_t *conf =
  -       (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
  +    server_rec *tmp = s;
   
  -   wc_close(conf->log);
  -   uri_worker_map_free(&(conf->uw_map), conf->log);
  -   map_free(&(conf->uri_to_context));
  -   if (conf->log)
  -      jk_close_file_logger(&(conf->log));
  +    /* loop through all available servers to clean up all configuration 
  +     * records we've created
  +     */  
  +    while (NULL != tmp)
  +    {
  +        jk_server_conf_t *conf =
  +            (jk_server_conf_t *)ap_get_module_config(tmp->module_config, &jk_module);
  +
  +        if (NULL != conf)
  +        {
  +            wc_close(conf->log);
  +            uri_worker_map_free(&(conf->uw_map), conf->log);
  +            map_free(&(conf->uri_to_context));
  +            if (conf->log)
  +                jk_close_file_logger(&(conf->log));
  +        }
  +        tmp = tmp->next;
  +    }
   }
   
   static const handler_rec jk_handlers[] =
  
  
  
  1.8       +1 -0      jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c
  
  Index: jk_ajp13_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_ajp13_worker.c	2001/04/19 21:26:43	1.7
  +++ jk_ajp13_worker.c	2001/06/01 08:41:15	1.8
  @@ -58,7 +58,7 @@
    * Author:      Henri Gomez <hgomez@slib.fr>                               *
    * Author:      Costin <costin@costin.dnt.ro>                              *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.7 $                                           *
  + * Version:     $Revision: 1.8 $                                           *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -138,6 +138,7 @@
   static void close_endpoint(ajp13_endpoint_t *ep)
   {
       reset_endpoint(ep);
  +    jk_close_pool(&(ep->pool));
       if(ep->sd > 0) {
           jk_close_socket(ep->sd);
       } 
  
  
  

Mime
View raw message