From: Victor Julien Date: Wed, 27 Apr 2022 19:15:25 +0000 (+0200) Subject: app-layer/expectation: reduce scope and init vars X-Git-Tag: suricata-7.0.0-beta1~610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4403e7fe8e3ca741fe175395d8eadb841ab6475e;p=thirdparty%2Fsuricata.git app-layer/expectation: reduce scope and init vars --- diff --git a/src/app-layer-expectation.c b/src/app-layer-expectation.c index 1f11d13f77..bf8b5b523d 100644 --- a/src/app-layer-expectation.c +++ b/src/app-layer-expectation.c @@ -124,11 +124,11 @@ static void AppLayerFreeExpectation(Expectation *exp) static void ExpectationListFree(void *el) { ExpectationList *exp_list = (ExpectationList *)el; - Expectation *exp, *pexp; if (exp_list == NULL) return; if (exp_list->length > 0) { + Expectation *exp = NULL, *pexp = NULL; CIRCLEQ_FOREACH_SAFE(exp, &exp_list->list, entries, pexp) { CIRCLEQ_REMOVE(&exp_list->list, exp, entries); exp_list->length--;