From: Victor Julien Date: Tue, 25 Apr 2023 05:23:58 +0000 (+0200) Subject: output: work around scan-build fp X-Git-Tag: suricata-7.0.0-rc2~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59df740e851868c58b4731b83a756f91495a2370;p=thirdparty%2Fsuricata.git output: work around scan-build fp runmodes.c:541:13: warning: Use of memory after it is freed [unix.Malloc] if (output->output_ctx != NULL && output->output_ctx->DeInit != NULL) ^~~~~~~~~~~~~~~~~~ 1 warning generated. --- diff --git a/src/runmodes.c b/src/runmodes.c index c36dcf45ee..60e68dcd64 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -535,13 +535,11 @@ static void RunOutputFreeList(void) { OutputFreeList *output; while ((output = TAILQ_FIRST(&output_free_list))) { - SCLogDebug("output %s %p %p", output->output_module->name, output, - output->output_ctx); + TAILQ_REMOVE(&output_free_list, output, entries); + SCLogDebug("output %s %p %p", output->output_module->name, output, output->output_ctx); if (output->output_ctx != NULL && output->output_ctx->DeInit != NULL) output->output_ctx->DeInit(output->output_ctx); - - TAILQ_REMOVE(&output_free_list, output, entries); SCFree(output); } }