]> granicus.if.org Git - apache/commitdiff
Fix a storage leak in mod_mime_magic.
authorJeff Trawick <trawick@apache.org>
Tue, 21 Aug 2001 12:16:53 +0000 (12:16 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 21 Aug 2001 12:16:53 +0000 (12:16 +0000)
Trivial to reproduce:

. enable mod_mime_magic
. copy "apache_pb.gif" to "picturefile"
. set breakpoint in magic_rsl_printf()
. request "picturefile"

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90466 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/metadata/mod_mime_magic.c

diff --git a/CHANGES b/CHANGES
index 5df73e87676ee9a20f2dd7226b71eedc4c380e1e..71fa7705b3797f07ca27f45d11ff0318bcc9df5a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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.
index 6012df313d699b3a75ad19f763ad52e9fb4246b6..02bf4598929509c7f33018a5cc44d2b68ecf19f2 100644 (file)
@@ -637,7 +637,7 @@ static int magic_rsl_printf(request_rec *r, char *str,...)
     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 */