FLOW_DESTROY added to clean-up UT's that init flow

remotes/origin/master-1.0.x
William Metcalf 16 years ago committed by Victor Julien
parent 9f0bf35cfd
commit 0e4235cc94

@ -36,6 +36,8 @@
#include "flow-util.h"
#include "detect-engine-state.h"
#include "stream-tcp-private.h"
#include "stream-tcp-reassemble.h"
#include "stream-tcp.h"
@ -1886,6 +1888,7 @@ int DCERPCParserTest01(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -2079,6 +2082,7 @@ int DCERPCParserTest02(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -2265,6 +2269,7 @@ int DCERPCParserTest03(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -33,6 +33,8 @@
#include "flow-util.h"
#include "detect-engine-state.h"
#include "stream-tcp-private.h"
#include "stream-tcp-reassemble.h"
#include "stream-tcp.h"
@ -326,6 +328,7 @@ int FTPParserTest01(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -428,6 +431,7 @@ int FTPParserTest06(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -480,6 +484,7 @@ int FTPParserTest07(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -533,6 +538,7 @@ int FTPParserTest10(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
#endif /* UNITTESTS */

@ -34,6 +34,8 @@
#include "flow-util.h"
#include "detect-engine-state.h"
#include "stream-tcp.h"
#include "stream-tcp-private.h"
#include "stream.h"
@ -1353,6 +1355,7 @@ static int AppLayerParserTest01 (void)
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -37,6 +37,8 @@
#include "stream-tcp.h"
#include "stream.h"
#include "detect-engine-state.h"
#include "app-layer-protos.h"
#include "app-layer-parser.h"
@ -298,6 +300,7 @@ static int SSLParserTest01(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -353,6 +356,7 @@ static int SSLParserTest02(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -689,6 +693,7 @@ static int SSLParserTest03(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
#endif /* UNITTESTS */

@ -30,6 +30,7 @@
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "detect-dce-iface.h"
#include "flow.h"
@ -926,6 +927,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1372,6 +1374,7 @@ static int DetectDceIfaceTestParse14(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -30,6 +30,7 @@
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "flow.h"
#include "flow-var.h"
@ -1210,6 +1211,7 @@ static int DetectDceOpnumTestParse08(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1718,6 +1720,7 @@ static int DetectDceOpnumTestParse09(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -2023,6 +2026,7 @@ static int DetectDceOpnumTestParse10(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -2273,6 +2277,7 @@ static int DetectDceOpnumTestParse11(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -2574,6 +2579,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -2820,6 +2826,7 @@ static int DetectDceOpnumTestParse13(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
#endif

@ -30,6 +30,7 @@
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "flow.h"
#include "flow-var.h"
@ -732,6 +733,7 @@ static int DetectDceStubDataTestParse02(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1240,6 +1242,7 @@ static int DetectDceStubDataTestParse03(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1519,6 +1522,7 @@ static int DetectDceStubDataTestParse04(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1758,6 +1762,7 @@ static int DetectDceStubDataTestParse05(void)
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -821,6 +821,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -990,8 +991,6 @@ static int DeStateSigTest02(void) {
result = 1;
end:
FLOW_DESTROY(&f);
if (det_ctx != NULL) {
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
}
@ -1002,6 +1001,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
#endif

@ -37,6 +37,7 @@
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "flow-bit.h"
#include "util-var-name.h"
@ -761,6 +762,7 @@ static int FlowBitsTestSig06(void) {
DetectEngineCtxFree(de_ctx);
if(gv) GenericVarFree(gv);
FLOW_DESTROY(&f);
return result;
end:
@ -779,7 +781,7 @@ end:
}
if(gv) GenericVarFree(gv);
FLOW_DESTROY(&f);
return result;
}
@ -861,6 +863,7 @@ static int FlowBitsTestSig07(void) {
DetectEngineCtxFree(de_ctx);
if(gv) GenericVarFree(gv);
FLOW_DESTROY(&f);
return result;
end:
@ -879,6 +882,7 @@ end:
}
if(gv) GenericVarFree(gv);
FLOW_DESTROY(&f);
return result;
}
@ -963,6 +967,7 @@ static int FlowBitsTestSig08(void) {
DetectEngineCtxFree(de_ctx);
if(gv) GenericVarFree(gv);
FLOW_DESTROY(&f);
return result;
end:
@ -981,6 +986,7 @@ end:
}
if(gv) GenericVarFree(gv);
FLOW_DESTROY(&f);
return result;
}

@ -30,6 +30,7 @@
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "detect-content.h"
#include "app-layer.h"
@ -427,6 +428,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -554,6 +556,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -31,6 +31,7 @@
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "detect-content.h"
#include "flow.h"
@ -534,6 +535,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -663,6 +665,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -793,6 +796,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -923,6 +927,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1053,6 +1058,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1154,6 +1160,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1255,6 +1262,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1356,6 +1364,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -31,6 +31,7 @@
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "detect-content.h"
#include "flow.h"
@ -529,6 +530,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -657,6 +659,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -784,6 +787,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -912,6 +916,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1040,6 +1045,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1140,6 +1146,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1240,6 +1247,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1341,6 +1349,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -32,6 +32,7 @@
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "detect-content.h"
#include "flow.h"
@ -488,6 +489,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -591,6 +593,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -680,6 +683,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -38,6 +38,7 @@
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "util-var-name.h"
#include "util-unittest-helper.h"
@ -1224,6 +1225,7 @@ static int DetectPcreTestSig01Real(int mpm_type) {
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
FLOW_DESTROY(&f);
end:
return result;
}
@ -1285,6 +1287,7 @@ static int DetectPcreTestSig02Real(int mpm_type) {
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
FLOW_DESTROY(&f);
end:
return result;
}
@ -1497,6 +1500,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1659,6 +1663,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -33,6 +33,7 @@
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "flow.h"
#include "flow-var.h"
@ -420,6 +421,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -534,6 +536,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -664,6 +667,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -32,6 +32,7 @@
#include "detect-engine-mpm.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-state.h"
#include "flow.h"
#include "detect-flow.h"
#include "flow-var.h"
@ -527,6 +528,7 @@ static int HTTPUriTest01(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -596,8 +598,8 @@ static int HTTPUriTest02(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
if (htp_state == NULL)
HTPStateFree(htp_state);
if (htp_state != NULL) HTPStateFree(htp_state);
FLOW_DESTROY(&f);
return result;
}
@ -665,8 +667,8 @@ static int HTTPUriTest03(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
if (htp_state == NULL)
HTPStateFree(htp_state);
if (htp_state != NULL) HTPStateFree(htp_state);
FLOW_DESTROY(&f);
return result;
}
@ -736,8 +738,8 @@ static int HTTPUriTest04(void) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
if (htp_state == NULL)
HTPStateFree(htp_state);
if (htp_state != NULL) HTPStateFree(htp_state);
FLOW_DESTROY(&f);
return result;
}
@ -893,6 +895,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1027,6 +1030,7 @@ end:
//FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1349,6 +1353,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1482,6 +1487,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
@ -1603,6 +1609,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
#endif /* UNITTESTS */

@ -30,6 +30,7 @@
#include "detect.h"
#include "detect-parse.h"
#include "detect-engine-state.h"
#include "detect-urilen.h"
#include "util-debug.h"
@ -575,6 +576,7 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}

@ -3513,6 +3513,7 @@ static int SigTest06Real (int mpm_type) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
static int SigTest06B2g (void) {
@ -3604,12 +3605,14 @@ end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
AppLayerParserCleanupState(&f);
FLOW_DESTROY(&f);
SigGroupCleanup(de_ctx);
SigCleanSignatures(de_ctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
//PatternMatchDestroy(mpm_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
static int SigTest07B2g (void) {
@ -3710,6 +3713,7 @@ static int SigTest08Real (int mpm_type) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
static int SigTest08B2g (void) {
@ -3806,6 +3810,7 @@ static int SigTest09Real (int mpm_type) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
static int SigTest09B2g (void) {
@ -3897,6 +3902,7 @@ static int SigTest10Real (int mpm_type) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
static int SigTest10B2g (void) {
@ -3974,6 +3980,7 @@ static int SigTest11Real (int mpm_type) {
end:
FlowL7DataPtrFree(&f);
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f);
return result;
}
static int SigTest11B2g (void) {
@ -4041,6 +4048,7 @@ end:
SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
}
FLOW_DESTROY(&f);
return result;
}
static int SigTest12B2g (void) {
@ -4106,6 +4114,7 @@ static int SigTest13Real (int mpm_type) {
//PatternMatchDestroy(mpm_ctx);
DetectEngineCtxFree(de_ctx);
end:
FLOW_DESTROY(&f);
return result;
}
static int SigTest13B2g (void) {
@ -4668,6 +4677,7 @@ static int SigTest21Real (int mpm_type) {
//PatternMatchDestroy(mpm_ctx);
DetectEngineCtxFree(de_ctx);
end:
FLOW_DESTROY(&f);
return result;
}
static int SigTest21B2g (void) {
@ -4760,6 +4770,7 @@ static int SigTest22Real (int mpm_type) {
//PatternMatchDestroy(mpm_ctx);
DetectEngineCtxFree(de_ctx);
end:
FLOW_DESTROY(&f);
return result;
}
static int SigTest22B2g (void) {
@ -4851,6 +4862,7 @@ static int SigTest23Real (int mpm_type) {
//PatternMatchDestroy(mpm_ctx);
DetectEngineCtxFree(de_ctx);
end:
FLOW_DESTROY(&f);
return result;
}
static int SigTest23B2g (void) {

@ -1657,12 +1657,12 @@ static int FlowTest03 (void) {
if (FlowTestPrune(&f, &ts) != 1) {
SCSpinDestroy(&fb.s);
SCMutexDestroy(&f.m);
FLOW_DESTROY(&f);
return 0;
}
SCSpinDestroy(&fb.s);
SCMutexDestroy(&f.m);
FLOW_DESTROY(&f);
return 1;
}
@ -1709,12 +1709,11 @@ static int FlowTest04 (void) {
if (FlowTestPrune(&f, &ts) != 1) {
SCSpinDestroy(&fb.s);
SCMutexDestroy(&f.m);
FLOW_DESTROY(&f);
return 0;
}
SCMutexDestroy(&f.m);
SCSpinDestroy(&fb.s);
FLOW_DESTROY(&f);
return 1;
}
@ -1751,12 +1750,12 @@ static int FlowTest05 (void) {
if (FlowTestPrune(&f, &ts) != 1) {
SCSpinDestroy(&fb.s);
SCMutexDestroy(&f.m);
FLOW_DESTROY(&f);
return 0;
}
SCSpinDestroy(&fb.s);
SCMutexDestroy(&f.m);
FLOW_DESTROY(&f);
return 1;
}
@ -1804,12 +1803,12 @@ static int FlowTest06 (void) {
if (FlowTestPrune(&f, &ts) != 1) {
SCSpinDestroy(&fb.s);
SCMutexDestroy(&f.m);
FLOW_DESTROY(&f);
return 0;
}
SCSpinDestroy(&fb.s);
SCMutexDestroy(&f.m);
FLOW_DESTROY(&f);
return 1;
}

Loading…
Cancel
Save