]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
signature: Fix leak in urilen parsing
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 7 Jan 2021 08:46:02 +0000 (09:46 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 12 Jan 2021 17:29:13 +0000 (18:29 +0100)
cf #4254

src/detect-urilen.c

index 3ba4322c0f61a47e84602e6cf547dd4827233b54..0a507840ec865be17367637cbc32344b88108c4c 100644 (file)
@@ -220,13 +220,15 @@ error:
     if (urilend)
         SCFree(urilend);
     if (arg1 != NULL)
-        SCFree(arg1);
+        pcre_free_substring(arg1);
     if (arg2 != NULL)
-        SCFree(arg2);
+        pcre_free_substring(arg2);
     if (arg3 != NULL)
-        SCFree(arg3);
+        pcre_free_substring(arg3);
     if (arg4 != NULL)
-        SCFree(arg4);
+        pcre_free_substring(arg4);
+    if (arg5 != NULL)
+        pcre_free_substring(arg5);
     return NULL;
 }
 
@@ -745,4 +747,4 @@ void DetectUrilenRegisterTests(void)
     UtRegisterTest("DetectUrilenSetpTest01", DetectUrilenSetpTest01);
     UtRegisterTest("DetectUrilenSigTest01", DetectUrilenSigTest01);
 }
-#endif /* UNITTESTS */
\ No newline at end of file
+#endif /* UNITTESTS */