From: Victor Julien Date: Fri, 11 Mar 2016 05:56:35 +0000 (+0100) Subject: lua: fix minor coverity issues X-Git-Tag: suricata-3.0.1RC1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dff9f65ce738094d1881053e1a41ddcfb9b032c7;p=thirdparty%2Fsuricata.git lua: fix minor coverity issues Remove checks that can never be false. CID 1232076, 1312012 --- diff --git a/src/output-lua.c b/src/output-lua.c index 4bfe495584..041e83efe7 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -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; }