]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
defrag: be sure to output NULL tracker
authorEric Leblond <eric@regit.org>
Thu, 6 Sep 2012 09:31:42 +0000 (11:31 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Sep 2012 11:40:46 +0000 (13:40 +0200)
Coverity 720337 pointed out a use after free. We can't be dependent
to HashListTableAdd outputting a NULL tracker.

src/defrag.c

index 0e017c677b8fb841eab8c2be35a4e5cb11e843c6..a221aa9defb0f3a3844e95c8ae7a64915282ae76 100644 (file)
@@ -1169,6 +1169,7 @@ DefragGetTracker(ThreadVars *tv, DecodeThreadVars *dtv, DefragContext *dc,
             SCMutexLock(&dc->tracker_pool_lock);
             PoolReturn(dc->tracker_pool, tracker);
             SCMutexUnlock(&dc->tracker_pool_lock);
+            tracker = NULL;
             goto done;
         }
     }