You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/08/21 14:16:53 UTC

cvs commit: httpd-2.0/modules/metadata mod_mime_magic.c

trawick     01/08/21 05:16:53

  Modified:    .        CHANGES
               modules/metadata mod_mime_magic.c
  Log:
  Fix a storage leak in mod_mime_magic.
  
  Trivial to reproduce:
  
  . enable mod_mime_magic
  . copy "apache_pb.gif" to "picturefile"
  . set breakpoint in magic_rsl_printf()
  . request "picturefile"
  
  Revision  Changes    Path
  1.320     +2 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.319
  retrieving revision 1.320
  diff -u -r1.319 -r1.320
  --- CHANGES	2001/08/20 19:47:51	1.319
  +++ CHANGES	2001/08/21 12:16:52	1.320
  @@ -1,5 +1,7 @@
   Changes with Apache 2.0.25-dev
   
  +  *) Fix a storage leak (a strdup() call) in mod_mime_magic.  [Jeff Trawick]
  +
     *) The prefork and OS/2 MPMs are overwriting the pid file when a second copy
        of httpd is started and shuts down due to socket conflict. Moving the
        call to ap_log_pid solves the problem.
  
  
  
  1.45      +1 -1      httpd-2.0/modules/metadata/mod_mime_magic.c
  
  Index: mod_mime_magic.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_mime_magic.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- mod_mime_magic.c	2001/06/07 14:45:03	1.44
  +++ mod_mime_magic.c	2001/08/21 12:16:53	1.45
  @@ -637,7 +637,7 @@
       va_end(ap);
   
       /* add the buffer to the list */
  -    return magic_rsl_add(r, strdup(buf));
  +    return magic_rsl_add(r, apr_pstrdup(r->pool, buf));
   }
   
   /* RSL hook for putchar-type functions */