httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_cgid.c
Date Tue, 02 Jan 2001 17:57:44 GMT
rbb         01/01/02 09:57:44

  Modified:    modules/generators mod_cgid.c
  Log:
  Change a bunch of mallocs in mod_cgid to apr_palloc.  These were never
  getting freed, and using malloc.  This was safe, because we were in
  the CGID process, but pools are just safer here.
  
  Revision  Changes    Path
  1.56      +8 -8      httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- mod_cgid.c	2000/12/23 07:09:01	1.55
  +++ mod_cgid.c	2001/01/02 17:57:42	1.56
  @@ -255,14 +255,17 @@
       read(fd, &i, sizeof(int)); 
        
       /* add 1, so that if i == 0, we still malloc something. */ 
  -    dconf = (void **)malloc(sizeof(void *) * i + 1); 
  +    dconf = (void **)apr_palloc(r->pool, sizeof(void *) * i + 1); 
  +    temp_core = (core_dir_config *)apr_palloc(r->pool, sizeof(core_module)); 
   
  -    temp_core = (core_dir_config *)malloc(sizeof(core_module)); 
  +    dconf[i] = (void *)temp_core; 
  +    r->per_dir_config = dconf; 
  +
   #if 0
   #ifdef RLIMIT_CPU 
       read(fd, &j, sizeof(int)); 
       if (j) { 
  -        temp_core->limit_cpu = (struct rlimit *)malloc (sizeof(struct rlimit)); 
  +        temp_core->limit_cpu = (struct rlimit *)apr_palloc (sizeof(struct rlimit));

           read(fd, temp_core->limit_cpu, sizeof(struct rlimit)); 
       } 
       else { 
  @@ -273,7 +276,7 @@
   #if defined (RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS) 
       read(fd, &j, sizeof(int)); 
       if (j) { 
  -        temp_core->limit_mem = (struct rlimit *)malloc (sizeof(struct rlimit)); 
  +        temp_core->limit_mem = (struct rlimit *)apr_palloc(r->pool, sizeof(struct
rlimit)); 
           read(fd, temp_core->limit_mem, sizeof(struct rlimit)); 
       } 
       else { 
  @@ -284,7 +287,7 @@
   #ifdef RLIMIT_NPROC 
       read(fd, &j, sizeof(int)); 
       if (j) { 
  -        temp_core->limit_nproc = (struct rlimit *)malloc (sizeof(struct rlimit)); 
  +        temp_core->limit_nproc = (struct rlimit *)apr_palloc(r->pool, sizeof(struct
rlimit)); 
           read(fd, temp_core->limit_nproc, sizeof(struct rlimit)); 
       } 
       else { 
  @@ -292,9 +295,6 @@
       } 
   #endif 
   #endif
  -    dconf[i] = (void *)temp_core; 
  -    r->per_dir_config = dconf; 
  -
       /* For right now, just make the notes table.  At some point we will need
        * to actually fill this out, but for now we just don't want suexec to
        * seg fault.
  
  
  

Mime
View raw message