From: Stefan Eissing Date: Fri, 23 Dec 2016 12:42:35 +0000 (+0000) Subject: On the trunk: X-Git-Tag: 2.5.0-alpha~877 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e84ccb6805c96ba0f4b084f7f2126828468313cd;p=apache On the trunk: Cleanup mod_http2 beamer registry on server reload. Fixes PR60510. * modules/http2/h2_bucket_beam.c register cleanup function on installation that NULLs the beamer registry on pool cleanup. Patch by: Pavel Mateja , Stefan Eissing] + *) mod_proxy_{ajp,fcgi}: Fix a possible crash when reusing an established backend connection, happening with LogLevel trace2 or higher configured, or at any log level with compilers not detected as C99 compliant (e.g. diff --git a/modules/http2/h2_bucket_beam.c b/modules/http2/h2_bucket_beam.c index 3d78a7937d..6d0b04920d 100644 --- a/modules/http2/h2_bucket_beam.c +++ b/modules/http2/h2_bucket_beam.c @@ -153,10 +153,19 @@ const apr_bucket_type_t h2_bucket_type_beam = { ******************************************************************************/ static apr_array_header_t *beamers; - + +static apr_status_t cleanup_beamers(void *dummy) +{ + (void)dummy; + beamers = NULL; + return APR_SUCCESS; +} + void h2_register_bucket_beamer(h2_bucket_beamer *beamer) { if (!beamers) { + apr_pool_cleanup_register(apr_hook_global_pool, NULL, + cleanup_beamers, apr_pool_cleanup_null); beamers = apr_array_make(apr_hook_global_pool, 10, sizeof(h2_bucket_beamer*)); }