This is an automated email from the ASF dual-hosted git repository.

gancho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  3b3a379   Coverity 1022124: Dereference before null check
3b3a379 is described below

commit 3b3a37985164b077fed8a6ce4b0554941a17090e
Author: Gancho Tenev <gan...@apache.com>
AuthorDate: Wed May 10 12:59:28 2017 -0700

    Coverity 1022124: Dereference before null check
    
    Problem:
      CID 1022124 (#1 of 1): Dereference before null check (REVERSE_INULL)
      check_after_deref: Null-checking txn_sm suggests that it may be null, but 
it has already been dereferenced on all paths leading to the check.
    
    Fix:
      Removed the check for NULL.
---
 example/protocol/TxnSM.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/example/protocol/TxnSM.c b/example/protocol/TxnSM.c
index 7978d31..db3005f 100644
--- a/example/protocol/TxnSM.c
+++ b/example/protocol/TxnSM.c
@@ -873,10 +873,9 @@ state_done(TSCont contp, TSEvent event ATS_UNUSED, TSVIO 
vio ATS_UNUSED)
     txn_sm->q_server_response = NULL;
   }
 
-  if (txn_sm) {
-    txn_sm->q_magic = TXN_SM_DEAD;
-    TSfree(txn_sm);
-  }
+  txn_sm->q_magic = TXN_SM_DEAD;
+  TSfree(txn_sm);
+
   TSContDestroy(contp);
   return TS_EVENT_NONE;
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Reply via email to