]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
lua: fix minor coverity issues
authorVictor Julien <victor@inliniac.net>
Fri, 11 Mar 2016 05:56:35 +0000 (06:56 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 12 Mar 2016 13:18:18 +0000 (14:18 +0100)
Remove checks that can never be false. CID 12320761312012

src/output-lua.c

index 4bfe49558440483c58f2ef6fc4b875dec1add4ed..041e83efe78352b8dfa4439a393e3e74b0df4707 100644 (file)
@@ -471,7 +471,7 @@ static int LuaFileLogger(ThreadVars *tv, void *thread_data, const Packet *p, con
     /* Get the TX so the script can get more context about it.
      * TODO hardcoded to HTTP currently */
     void *txptr = NULL;
-    if (p && p->flow && p->flow->alstate)
+    if (p->flow && p->flow->alstate)
         txptr = AppLayerParserGetTx(p->proto, ALPROTO_HTTP, p->flow->alstate, ff->txid);
 
     SCMutexLock(&td->lua_ctx->m);
@@ -980,12 +980,9 @@ static OutputCtx *OutputLuaLogInit(ConfNode *conf)
     return output_ctx;
 
 error:
-
-    if (output_ctx != NULL) {
-        if (output_ctx->DeInit && output_ctx->data)
-            output_ctx->DeInit(output_ctx->data);
-        SCFree(output_ctx);
-    }
+    if (output_ctx->DeInit && output_ctx->data)
+        output_ctx->DeInit(output_ctx->data);
+    SCFree(output_ctx);
     return NULL;
 }