log: Coverity REVERSE_INULL warnings

This commit addresses Coverity reported "REVERSE_INULL" warnings.

Issue: 4699
pull/6779/head
Jeff Lucovsky 3 years ago committed by Victor Julien
parent e1c0725e05
commit 22e89ec4a3

@ -1099,8 +1099,7 @@ OutputInitResult OutputJsonInitCtx(ConfNode *conf)
json_ctx->file_ctx = LogFileNewCtx();
if (unlikely(json_ctx->file_ctx == NULL)) {
SCLogDebug("AlertJsonInitCtx: Could not create new LogFileCtx");
SCFree(json_ctx);
return result;
goto error_exit;
}
if (sensor_name) {
@ -1238,11 +1237,16 @@ OutputInitResult OutputJsonInitCtx(ConfNode *conf)
error_exit:
if (json_ctx->file_ctx) {
if (json_ctx->file_ctx->prefix) {
SCFree(json_ctx->file_ctx->prefix);
}
if (json_ctx->file_ctx->sensor_name) {
SCFree(json_ctx->file_ctx->sensor_name);
}
LogFileFreeCtx(json_ctx->file_ctx);
}
if (json_ctx) {
SCFree(json_ctx);
}
SCFree(json_ctx);
if (output_ctx) {
SCFree(output_ctx);
}

Loading…
Cancel
Save