From: Victor Julien Date: Fri, 24 Apr 2020 08:27:18 +0000 (+0200) Subject: fastlog: fix unlikely memleak X-Git-Tag: suricata-6.0.0-beta1~472 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28837b203e45a8cc24b4b7b97f7bf9c5e118eb7b;p=thirdparty%2Fsuricata.git fastlog: fix unlikely memleak Fix memleak is case of alloc error during startup. --- diff --git a/src/alert-fastlog.c b/src/alert-fastlog.c index f1cd686417..7d955f307b 100644 --- a/src/alert-fastlog.c +++ b/src/alert-fastlog.c @@ -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;