From: Jason Ish Date: Mon, 19 Sep 2022 16:40:14 +0000 (-0600) Subject: detect: fix user after free in debug log X-Git-Tag: suricata-6.0.7~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ca09ecbcd1d67106f45abfce2e03f185382e2a7;p=thirdparty%2Fsuricata.git detect: fix user after free in debug log Found by gcc 12.2.1. --- diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c index d9030b0373..e9604384a3 100644 --- a/src/detect-engine-iponly.c +++ b/src/detect-engine-iponly.c @@ -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)