From: Joe Orton Date: Tue, 19 Mar 2024 08:38:00 +0000 (+0000) Subject: Merge r1915281 from trunk: X-Git-Tag: 2.4.59-rc1-candidate~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7f0f9bf11694ff54303267534b936ea308979e5;p=thirdparty%2Fapache%2Fhttpd.git Merge r1915281 from trunk: *) mod_http2: v2.0.26 with the following fixes: - Fixed `Date` header on requests upgraded from HTTP/1.1 (h2c). Fixes . - Fixed small memory leak in h2 header bucket free. Thanks to Michael Kaufmann for finding this and providing the fix. Submitted by: icing Reviewed by: icing, gbechis, jorton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1916413 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/h2_date_and_bucket_leak.txt b/changes-entries/h2_date_and_bucket_leak.txt new file mode 100644 index 00000000000..3144d5a0473 --- /dev/null +++ b/changes-entries/h2_date_and_bucket_leak.txt @@ -0,0 +1,6 @@ + *) mod_http2: v2.0.26 with the following fixes: + - Fixed `Date` header on requests upgraded from HTTP/1.1 (h2c). Fixes + . + - Fixed small memory leak in h2 header bucket free. Thanks to + Michael Kaufmann for finding this and providing the fix. + diff --git a/modules/http2/h2_headers.c b/modules/http2/h2_headers.c index 0fc1d91d6a2..d9b3fd09b06 100644 --- a/modules/http2/h2_headers.c +++ b/modules/http2/h2_headers.c @@ -90,9 +90,18 @@ h2_headers *h2_bucket_headers_get(apr_bucket *b) return NULL; } +static void bucket_destroy(void *data) +{ + h2_bucket_headers *h = data; + + if (apr_bucket_shared_destroy(h)) { + apr_bucket_free(h); + } +} + const apr_bucket_type_t h2_bucket_type_headers = { "H2HEADERS", 5, APR_BUCKET_METADATA, - apr_bucket_destroy_noop, + bucket_destroy, bucket_read, apr_bucket_setaside_noop, apr_bucket_split_notimpl, diff --git a/modules/http2/h2_request.c b/modules/http2/h2_request.c index de312e58895..2713947c377 100644 --- a/modules/http2/h2_request.c +++ b/modules/http2/h2_request.c @@ -120,6 +120,7 @@ apr_status_t h2_request_rcreate(h2_request **preq, apr_pool_t *pool, req->path = path; req->headers = apr_table_make(pool, 10); req->http_status = H2_HTTP_STATUS_UNSET; + req->request_time = apr_time_now(); x.pool = pool; x.headers = req->headers;