]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
profiling: end profiling tunnel packets inside lock 820/head
authorVictor Julien <victor@inliniac.net>
Tue, 4 Feb 2014 17:18:46 +0000 (18:18 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 4 Feb 2014 17:20:29 +0000 (18:20 +0100)
End profiling inside the lock for a tunnel packet as otherwise another
thread may already free the packet while the profiling code runs.

SEGV's observed and now gone.

src/tmqh-packetpool.c

index 1053d6be381954c067ddf3e2831d30e6a2d9d871..531af50c33baa2f7b0695a50738ef2412b6eb810 100644 (file)
@@ -213,9 +213,8 @@ void TmqhOutputPacketpool(ThreadVars *t, Packet *p)
                  * when we handle them */
                 SET_TUNNEL_PKT_VERDICTED(p);
 
-                SCMutexUnlock(m);
-
                 PACKET_PROFILING_END(p);
+                SCMutexUnlock(m);
                 SCReturn;
             }
         } else {