From b59de5a08c380a68c565e63aad5973d9fd0d0c7d Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 6 Sep 2002 01:27:48 +0000 Subject: [PATCH] Clean up the temporary brigade in error cases in ap_discard_request_body() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96663 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_protocol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 5087425b50..2d5378c3b2 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1912,9 +1912,11 @@ AP_DECLARE(int) ap_discard_request_body(request_rec *r) * Otherwise, we should assume we have a bad request. */ if (rv == AP_FILTER_ERROR) { + apr_brigade_destroy(bb); return rv; } else { + apr_brigade_destroy(bb); return HTTP_BAD_REQUEST; } } @@ -1938,6 +1940,7 @@ AP_DECLARE(int) ap_discard_request_body(request_rec *r) */ rv = apr_bucket_read(bucket, &data, &len, APR_BLOCK_READ); if (rv != APR_SUCCESS) { + apr_brigade_destroy(bb); return HTTP_BAD_REQUEST; } } -- 2.40.0