fastlog: fix unlikely memleak

Fix memleak is case of alloc error during startup.
pull/4864/head
Victor Julien 6 years ago
parent b763885d1b
commit 28837b203e

@ -238,8 +238,11 @@ OutputInitResult AlertFastLogInitCtx(ConfNode *conf)
}
OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
if (unlikely(output_ctx == NULL))
if (unlikely(output_ctx == NULL)) {
LogFileFreeCtx(logfile_ctx);
return result;
}
output_ctx->data = logfile_ctx;
output_ctx->DeInit = AlertFastLogDeInitCtx;

Loading…
Cancel
Save