]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
htp: remove user setup from request line callback
authorVictor Julien <vjulien@oisf.net>
Thu, 15 Sep 2022 15:25:49 +0000 (17:25 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 20 Sep 2022 09:24:10 +0000 (11:24 +0200)
This used to be the first callback that was called, but its not anymore.

Codecov confirmed that this is no longer used and therefore not useful.

src/app-layer-htp.c

index d7d9233d590cb8bc6e37b8d0c5b39f347162ea34..cf8123b9a71c3d02e03463ddbd33a020cbcb9873 100644 (file)
@@ -2310,14 +2310,8 @@ static int HTPCallbackRequestLine(htp_tx_t *tx)
         return HTP_OK;
 
     tx_ud = htp_tx_get_user_data(tx);
-    if (likely(tx_ud == NULL)) {
-        tx_ud = HTPMalloc(sizeof(*tx_ud));
-        if (unlikely(tx_ud == NULL)) {
-            bstr_free(request_uri_normalized);
-            return HTP_OK;
-        }
-        memset(tx_ud, 0, sizeof(*tx_ud));
-        htp_tx_set_user_data(tx, tx_ud);
+    if (unlikely(tx_ud == NULL)) {
+        return HTP_OK;
     }
     if (unlikely(tx_ud->request_uri_normalized != NULL))
         bstr_free(tx_ud->request_uri_normalized);