output-json: fix minor memory leak on error

If the json file couldn't be opened, a minor memory leak would occur.

Coverity 1166039
pull/851/head
Victor Julien 13 years ago
parent b4ab9a0a3c
commit d8c486231c

@ -409,6 +409,7 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf)
if (SCConfLogOpenGeneric(conf, json_ctx->file_ctx, DEFAULT_LOG_FILENAME) < 0) { if (SCConfLogOpenGeneric(conf, json_ctx->file_ctx, DEFAULT_LOG_FILENAME) < 0) {
LogFileFreeCtx(json_ctx->file_ctx); LogFileFreeCtx(json_ctx->file_ctx);
SCFree(json_ctx); SCFree(json_ctx);
SCFree(output_ctx);
return NULL; return NULL;
} }

Loading…
Cancel
Save