From 52eb79c79fb5ef8c3b46c0df2bfd0f5441f5ff17 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 21 Aug 2001 12:16:53 +0000 Subject: [PATCH] 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" git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90466 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ modules/metadata/mod_mime_magic.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5df73e8767..71fa7705b3 100644 --- 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. diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index 6012df313d..02bf459892 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -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 */ -- 2.50.1