]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/ssh: minor cleanup
authorVictor Julien <victor@inliniac.net>
Fri, 24 Jul 2020 08:36:55 +0000 (10:36 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 24 Jul 2020 11:04:42 +0000 (13:04 +0200)
src/output-json-ssh.c

index 6f5ad4d203b3f1e62062d064689c6199351f3619..dd74a6a0519736f70218781e8bc2238407452e46 100644 (file)
@@ -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;