[Pkg-apache-commits] r1149 - in /trunk/apache2: changelog patches/00list patches/078_avoid_brigade_destroy.dpatch
sf at alioth.debian.org
sf at alioth.debian.org
Sat Feb 20 10:33:57 UTC 2010
Author: sf
Date: Sat Feb 20 10:33:54 2010
New Revision: 1149
URL: http://svn.debian.org/wsvn/pkg-apache/?sc=1&rev=1149
Log:
Fix potential memory leaks related to the usage of apr_brigade_destroy()
Added:
trunk/apache2/patches/078_avoid_brigade_destroy.dpatch
Modified:
trunk/apache2/changelog
trunk/apache2/patches/00list
Modified: trunk/apache2/changelog
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/changelog?rev=1149&op=diff
==============================================================================
--- trunk/apache2/changelog (original)
+++ trunk/apache2/changelog Sat Feb 20 10:33:54 2010
@@ -1,3 +1,9 @@
+apache2 (2.2.14-7) UNRELEASED; urgency=low
+
+ * Fix potential memory leaks related to the usage of apr_brigade_destroy().
+
+ -- Stefan Fritsch <sf at debian.org> Fri, 19 Feb 2010 19:02:32 +0100
+
apache2 (2.2.14-6) unstable; urgency=low
* Use environment variables APACHE_RUN_DIR, APACHE_LOCK_DIR, and
Modified: trunk/apache2/patches/00list
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/patches/00list?rev=1149&op=diff
==============================================================================
--- trunk/apache2/patches/00list (original)
+++ trunk/apache2/patches/00list Sat Feb 20 10:33:54 2010
@@ -25,6 +25,7 @@
075_mod_rewrite_literal_ipv6_redirect.dpatch
076_apxs2_a2enmod.dpatch
077_CacheIgnoreURLSessionIdentifiers.dpatch
+078_avoid_brigade_destroy.dpatch
099_config_guess_sub_update
200_cp_suexec.dpatch
201_build_suexec-custom.dpatch
Added: trunk/apache2/patches/078_avoid_brigade_destroy.dpatch
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/patches/078_avoid_brigade_destroy.dpatch?rev=1149&op=file
==============================================================================
--- trunk/apache2/patches/078_avoid_brigade_destroy.dpatch (added)
+++ trunk/apache2/patches/078_avoid_brigade_destroy.dpatch Sat Feb 20 10:33:54 2010
@@ -1,0 +1,92 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: avoid potential mem leaks
+## DP: adapted from r821477 from upstream svn
+
+ at DPATCH@
+Index: server/core_filters.c
+===================================================================
+--- a/server/core_filters.c (Revision 911217)
++++ a/server/core_filters.c (Arbeitskopie)
+@@ -655,6 +655,8 @@
+ /* Create a temporary brigade as a means
+ * of concatenating a bunch of buckets together
+ */
++ temp_brig = apr_brigade_create(f->c->pool,
++ f->c->bucket_alloc);
+ if (last_merged_bucket) {
+ /* If we've concatenated together small
+ * buckets already in a previous pass,
+@@ -667,16 +669,9 @@
+ * these buckets, so that the content
+ * in them doesn't have to be copied again.
+ */
+- apr_bucket_brigade *bb;
+- bb = apr_brigade_split(b,
+- APR_BUCKET_NEXT(last_merged_bucket));
+- temp_brig = b;
+- b = bb;
++ APR_BRIGADE_PREPEND(b, temp_brig);
++ brigade_move(temp_brig, b, APR_BUCKET_NEXT(last_merged_bucket));
+ }
+- else {
+- temp_brig = apr_brigade_create(f->c->pool,
+- f->c->bucket_alloc);
+- }
+
+ temp = APR_BRIGADE_FIRST(b);
+ while (temp != e) {
+@@ -879,7 +874,7 @@
+ logio_add_bytes_out(c, bytes_sent);
+ }
+
+- apr_brigade_destroy(b);
++ apr_brigade_cleanup(b);
+
+ /* drive cleanups for resources which were set aside
+ * this may occur before or after termination of the request which
+@@ -910,7 +905,7 @@
+ "core_output_filter: writing data to the network");
+
+ if (more)
+- apr_brigade_destroy(more);
++ apr_brigade_cleanup(more);
+
+ /* No need to check for SUCCESS, we did that above. */
+ if (!APR_STATUS_IS_EAGAIN(rv)) {
+Index: modules/http/byterange_filter.c
+===================================================================
+--- a/modules/http/byterange_filter.c (Revision 911217)
++++ a/modules/http/byterange_filter.c (Arbeitskopie)
+@@ -308,7 +308,7 @@
+ APR_BRIGADE_INSERT_TAIL(bsend, e);
+
+ /* we're done with the original content - all of our data is in bsend. */
+- apr_brigade_destroy(bb);
++ apr_brigade_cleanup(bb);
+
+ /* send our multipart output */
+ return ap_pass_brigade(f->next, bsend);
+Index: modules/http/http_filters.c
+===================================================================
+--- a/modules/http/http_filters.c (Revision 911217)
++++ a/modules/http/http_filters.c (Arbeitskopie)
+@@ -1120,7 +1120,7 @@
+ ctx = f->ctx = apr_pcalloc(r->pool, sizeof(header_filter_ctx));
+ }
+ else if (ctx->headers_sent) {
+- apr_brigade_destroy(b);
++ apr_brigade_cleanup(b);
+ return OK;
+ }
+ }
+@@ -1291,7 +1291,7 @@
+ ap_pass_brigade(f->next, b2);
+
+ if (r->header_only) {
+- apr_brigade_destroy(b);
++ apr_brigade_cleanup(b);
+ ctx->headers_sent = 1;
+ return OK;
+ }
More information about the Pkg-apache-commits
mailing list