eve/ssh: minor cleanup

pull/5216/head
Victor Julien 6 years ago
parent 0c92b8f7e4
commit 085eb9fc8e

@ -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 * You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free * 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) 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)); JsonSshLogThread *aft = SCMalloc(sizeof(JsonSshLogThread));
if (unlikely(aft == NULL)) if (unlikely(aft == NULL))
return TM_ECODE_FAILED; return TM_ECODE_FAILED;
memset(aft, 0, sizeof(JsonSshLogThread)); 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) */ /* Use the Ouptut Context (file pointer and mutex) */
aft->sshlog_ctx = ((OutputCtx *)initdata)->data; aft->sshlog_ctx = ((OutputCtx *)initdata)->data;

Loading…
Cancel
Save