From ce1753c71555ad4060943f64336a63cdd352d3f0 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 23 Oct 2018 16:17:26 +0200 Subject: [PATCH] htp: fix potential (but unlikely) memleak in uri normalization --- src/app-layer-htp-libhtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app-layer-htp-libhtp.c b/src/app-layer-htp-libhtp.c index 3f040213fa..a4ef784b0e 100644 --- a/src/app-layer-htp-libhtp.c +++ b/src/app-layer-htp-libhtp.c @@ -127,7 +127,7 @@ bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, int uri_include_a bstr_add_noex(r, uri->username); } - bstr_add_c(r, ":"); + bstr_add_c_noex(r, ":"); if (uri->password != NULL) { bstr_add_noex(r, uri->password); @@ -141,7 +141,7 @@ bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, int uri_include_a } if (uri->port != NULL) { - bstr_add_c(r, ":"); + bstr_add_c_noex(r, ":"); bstr_add_noex(r, uri->port); } }