]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: fix user after free in debug log
authorJason Ish <jason.ish@oisf.net>
Mon, 19 Sep 2022 16:40:14 +0000 (10:40 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 26 Sep 2022 15:27:55 +0000 (17:27 +0200)
Found by gcc 12.2.1.

src/detect-engine-iponly.c

index d9030b03732839e11053625149d2b3de47899f3a..e9604384a3900277ec98225b8d8e97e4247f4ebb 100644 (file)
@@ -462,8 +462,8 @@ void IPOnlyCIDRListFree(IPOnlyCIDRItem *tmphead)
 
     while (it != NULL) {
         i++;
-        SCFree(it);
         SCLogDebug("Item(%p) %"PRIu32" removed", it, i);
+        SCFree(it);
         it = next;
 
         if (next != NULL)