From 95dbc8ea9a4ddef98bd8910d32e6c88cb331ba97 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 5 Sep 2002 06:20:02 +0000 Subject: [PATCH] Free the temporary working brigade upon exit from ap_get_client_block() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96639 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_protocol.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index faf6463ba2..c30e56d00f 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1824,6 +1824,10 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, apr_bucket_brigade *bb; bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); + if (bb == NULL) { + r->connection->keepalive = AP_CONN_CLOSE; + return -1; + } rv = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES, APR_BLOCK_READ, bufsiz); @@ -1836,6 +1840,7 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, * stop trying to read data from the client. */ r->connection->keepalive = AP_CONN_CLOSE; + apr_brigade_destroy(bb); return -1; } @@ -1847,12 +1852,14 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, rv = apr_brigade_flatten(bb, buffer, &bufsiz); if (rv != APR_SUCCESS) { + apr_brigade_destroy(bb); return -1; } /* XXX yank me? */ r->read_length += bufsiz; + apr_brigade_destroy(bb); return bufsiz; } -- 2.40.0