Skip to content

Commit

Permalink
Fix h2_header bucket memory leak. [Michael Kaufmann]
Browse files Browse the repository at this point in the history
  • Loading branch information
icing committed Jan 17, 2024
1 parent bd4a830 commit 830a7fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mod_http2/h2_headers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 830a7fb

Please sign in to comment.