/**
* \brief Cleanup a packet so that we can free it. No memset needed..
*/
-#define PACKET_DESTRUCTOR(p) do { \
- if ((p)->pktvar != NULL) { \
- PktVarFree((p)->pktvar); \
- } \
- PACKET_FREE_EXTDATA((p)); \
- SCMutexDestroy(&(p)->tunnel_mutex); \
- AppLayerDecoderEventsFreeEvents(&(p)->app_layer_events); \
- PACKET_PROFILING_RESET((p)); \
+#define PACKET_DESTRUCTOR(p) \
+ do { \
+ PACKET_RELEASE_REFS((p)); \
+ if ((p)->pktvar != NULL) { \
+ PktVarFree((p)->pktvar); \
+ } \
+ PACKET_FREE_EXTDATA((p)); \
+ SCMutexDestroy(&(p)->tunnel_mutex); \
+ AppLayerDecoderEventsFreeEvents(&(p)->app_layer_events); \
+ PACKET_PROFILING_RESET((p)); \
} while (0)
-
/* macro's for setting the action
* handle the case of a root packet
* for tunnels */
void PacketPoolReturnPacket(Packet *p)
{
PktPool *my_pool = GetThreadPacketPool();
-
- PACKET_RELEASE_REFS(p);
-
PktPool *pool = p->pool;
if (pool == NULL) {
PacketFree(p);
return;
}
+
+ PACKET_RELEASE_REFS(p);
+
#ifdef DEBUG_VALIDATION
BUG_ON(pool->initialized == 0);
BUG_ON(pool->destroyed == 1);