From 085eb9fc8e27fc81344092f041a21146b5c63ddf Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 24 Jul 2020 10:36:55 +0200 Subject: [PATCH] eve/ssh: minor cleanup --- src/output-json-ssh.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/output-json-ssh.c b/src/output-json-ssh.c index 6f5ad4d203..dd74a6a051 100644 --- a/src/output-json-ssh.c +++ b/src/output-json-ssh.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Open Information Security Foundation +/* Copyright (C) 2014-2020 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -98,18 +98,16 @@ end: static TmEcode JsonSshLogThreadInit(ThreadVars *t, const void *initdata, void **data) { + if (initdata == NULL) { + SCLogDebug("Error getting context for EveLogSSH. \"initdata\" argument NULL"); + return TM_ECODE_FAILED; + } + JsonSshLogThread *aft = SCMalloc(sizeof(JsonSshLogThread)); if (unlikely(aft == NULL)) return TM_ECODE_FAILED; memset(aft, 0, sizeof(JsonSshLogThread)); - if(initdata == NULL) - { - SCLogDebug("Error getting context for EveLogSSH. \"initdata\" argument NULL"); - SCFree(aft); - return TM_ECODE_FAILED; - } - /* Use the Ouptut Context (file pointer and mutex) */ aft->sshlog_ctx = ((OutputCtx *)initdata)->data;