]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1883730 from trunk:
authorYann Ylavic <ylavic@apache.org>
Tue, 5 Jan 2021 10:26:40 +0000 (10:26 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 5 Jan 2021 10:26:40 +0000 (10:26 +0000)
mod_case_filter_in: fix memory leak.

Each ap_malloc()ed buffer should be free()d with its bucket.

Submitted by: ylavic
Reviewed by: ylavic, jorton, covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885140 13f79535-47bb-0310-9956-ffa450edef68

modules/examples/mod_case_filter_in.c

index 5116e3b9f62251d1d49a99257dddee9065e190fd..c70a9eb9e6c1761f100100ca857e401d27e8adcb 100644 (file)
@@ -114,7 +114,7 @@ static apr_status_t CaseFilterInFilter(ap_filter_t *f,
             buf[n] = apr_toupper(data[n]);
         }
 
-        pbktOut = apr_bucket_heap_create(buf, len, 0, c->bucket_alloc);
+        pbktOut = apr_bucket_heap_create(buf, len, free, c->bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(pbbOut, pbktOut);
         apr_bucket_delete(pbktIn);
     }