From: Jason Ish Date: Tue, 11 Aug 2020 15:30:01 +0000 (-0600) Subject: output-json: fix Coverity USE_AFTER_FREE X-Git-Tag: suricata-6.0.0-rc1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2a1626b513d9ecae0290298c2a0956505c25ddd;p=thirdparty%2Fsuricata.git output-json: fix Coverity USE_AFTER_FREE Return error if plugin open fails. Fixes Coverity CID 1465664 USE_AFTER_FREE error. Redmine issue: https://redmine.openinfosecfoundation.org/issues/3864 --- diff --git a/src/output-json.c b/src/output-json.c index 8353877755..7e55ba0385 100644 --- a/src/output-json.c +++ b/src/output-json.c @@ -1198,6 +1198,7 @@ OutputInitResult OutputJsonInitCtx(ConfNode *conf) LogFileFreeCtx(json_ctx->file_ctx); SCFree(json_ctx); SCFree(output_ctx); + return result; } else { json_ctx->file_ctx->plugin = json_ctx->plugin; json_ctx->file_ctx->plugin_data = plugin_data;