#include "util-unittest.h"
#define TEST_START \
- Packet *p = SCMalloc(SIZE_OF_PACKET); \
+ Packet *p = PacketGetFromAlloc(); \
FAIL_IF_NULL(p); \
Flow f; \
ThreadVars tv; \
StreamTcpSessionClear(p->flow->protoctx); \
StreamTcpThreadDeinit(&tv, (void *)stt); \
StreamTcpFreeConfig(TRUE); \
- PACKET_DESTRUCTOR(p); \
- SCFree(p); \
+ PacketFree(p); \
FLOW_DESTROY(&f); \
StatsThreadCleanup(&tv);
"Host: one.example.org\r\n"
"\r\n";
uint16_t buflen = strlen((char *)buf);
- Packet *p = SCMalloc(SIZE_OF_PACKET);
+ Packet *p = PacketGetFromAlloc();
FAIL_IF_NULL(p);
Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
+ PacketFree(p);
HostBitsTestShutdown();
-
- SCFree(p);
PASS;
}
"Host: one.example.org\r\n"
"\r\n";
uint16_t buflen = strlen((char *)buf);
- Packet *p = SCMalloc(SIZE_OF_PACKET);
+ Packet *p = PacketGetFromAlloc();
if (unlikely(p == NULL))
return 0;
Signature *s = NULL;
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
+ PacketFree(p);
HostBitsTestShutdown();
- SCFree(p);
PASS;
}
"Host: one.example.org\r\n"
"\r\n";
uint16_t buflen = strlen((char *)buf);
- Packet *p = SCMalloc(SIZE_OF_PACKET);
- if (unlikely(p == NULL))
- return 0;
+ Packet *p = PacketGetFromAlloc();
Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
+ PacketFree(p);
HostBitsTestShutdown();
- SCFree(p);
PASS;
}
"Host: one.example.org\r\n"
"\r\n";
uint16_t buflen = strlen((char *)buf);
- Packet *p = SCMalloc(SIZE_OF_PACKET);
- if (unlikely(p == NULL))
- return 0;
+ Packet *p = PacketGetFromAlloc();
Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
DetectEngineCtxFree(de_ctx);
FLOW_DESTROY(&f);
-
+ PacketFree(p);
HostBitsTestShutdown();
- SCFree(p);
PASS;
}
"Host: one.example.org\r\n"
"\r\n";
uint16_t buflen = strlen((char *)buf);
- Packet *p = SCMalloc(SIZE_OF_PACKET);
- if (unlikely(p == NULL))
- return 0;
+ Packet *p = PacketGetFromAlloc();
Signature *s = NULL;
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
DetectEngineCtxFree(de_ctx);
FLOW_DESTROY(&f);
-
+ PacketFree(p);
HostBitsTestShutdown();
- SCFree(p);
PASS;
}
UtRegisterTest("HostBitsTestSig07", HostBitsTestSig07);
UtRegisterTest("HostBitsTestSig08", HostBitsTestSig08);
}
-#endif /* UNITTESTS */
\ No newline at end of file
+#endif /* UNITTESTS */