From: Victor Julien Date: Fri, 17 Jul 2015 13:31:56 +0000 (+0200) Subject: http: destroy htp_tx_t even if incomplete X-Git-Tag: suricata-3.0RC1~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbc9874b817fcdfda4fac71e806bc4c077ba001e;p=thirdparty%2Fsuricata.git http: destroy htp_tx_t even if incomplete --- diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 8444afe651..1a9c41a5c0 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -408,6 +408,17 @@ static void HTPStateTransactionFree(void *state, uint64_t id) HtpTxUserDataFree(s, htud); htp_tx_set_user_data(tx, NULL); + /* hack: even if libhtp considers the tx incomplete, we want to + * free it here. htp_tx_destroy however, will refuse to do this. + * As htp_tx_destroy_incomplete isn't available in the public API, + * we hack around it here. */ + if (unlikely(!( + tx->request_progress == HTP_REQUEST_COMPLETE && + tx->response_progress == HTP_RESPONSE_COMPLETE))) + { + tx->request_progress = HTP_REQUEST_COMPLETE; + tx->response_progress = HTP_RESPONSE_COMPLETE; + } htp_tx_destroy(tx); } }