From: Victor Julien Date: Wed, 26 Feb 2014 05:20:19 +0000 (+0100) Subject: output-json: fix minor memory leak on error X-Git-Tag: suricata-2.0rc2~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8c486231c8679afd91dfd3ffb7d187c9bb0ed63;p=thirdparty%2Fsuricata.git output-json: fix minor memory leak on error If the json file couldn't be opened, a minor memory leak would occur. Coverity 1166039 --- diff --git a/src/output-json.c b/src/output-json.c index 0483d668b1..e0b2257746 100644 --- a/src/output-json.c +++ b/src/output-json.c @@ -409,6 +409,7 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf) if (SCConfLogOpenGeneric(conf, json_ctx->file_ctx, DEFAULT_LOG_FILENAME) < 0) { LogFileFreeCtx(json_ctx->file_ctx); SCFree(json_ctx); + SCFree(output_ctx); return NULL; }