From: Willy Tarreau Date: Thu, 24 Jan 2013 14:58:42 +0000 (+0100) Subject: CLEANUP: http: don't try to deinitialize http compression if it fails before init X-Git-Tag: v1.5-dev18~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=192e59fb0737cda156acfd652618c77cd00f07bd;p=thirdparty%2Fhaproxy.git CLEANUP: http: don't try to deinitialize http compression if it fails before init In select_compression_response_header(), some tests are rather confusing as the "fail" label is used to deinitialize the compression context for the session while it's branched only before initialization succeeds. The test is always false here and the dereferencing of the comp_algo pointer which might be null is also confusing. Remove that code which is not needed anymore since commit ec3e3890 got rid of the latest issues. Reported-by: Dinko Korunic --- diff --git a/src/proto_http.c b/src/proto_http.c index 3d68da89dd..da3935c3e3 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -2028,7 +2028,6 @@ int select_compression_request_header(struct session *s, struct buffer *req) } s->comp_algo = NULL; - return 0; } @@ -2138,14 +2137,10 @@ int select_compression_response_header(struct session *s, struct buffer *res) trash.str[trash.len] = '\0'; http_header_add_tail2(&txn->rsp, &txn->hdr_idx, trash.str, trash.len); } - return 1; fail: - if (s->flags & SN_COMP_READY) - s->comp_algo->end(&s->comp_ctx); s->comp_algo = NULL; - s->flags &= ~SN_COMP_READY; return 0; }