Commit 013c375c authored by Jeff Trawick's avatar Jeff Trawick
Browse files

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
parent 9c8b3a4d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
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 −1
Original line number Diff line number Diff line
@@ -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 */