app-layer/expectation: reduce scope and init vars

pull/7392/head
Victor Julien 3 years ago
parent 6c3222dee6
commit 4403e7fe8e

@ -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--;

Loading…
Cancel
Save