if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars tv;
DecodeThreadVars dtv;
int result = 0;
*/
int DetectBytejumpTestParse09(void) {
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 1;
s->alproto = ALPROTO_DCERPC;
*/
int DetectBytetestTestParse19(void) {
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 1;
s->alproto = ALPROTO_DCERPC;
SigFree(s);
s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
result &= (DetectContentSetup(de_ctx, s, "\"one\"") == 0);
result &= (s->sm_lists[DETECT_SM_LIST_DMATCH] == NULL && s->sm_lists[DETECT_SM_LIST_PMATCH] != NULL);
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
static int DetectDceIfaceTestParse08(void)
{
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 0;
DetectDceIfaceData *did = NULL;
uint8_t test_uuid[] = {0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34,
SCEnter();
Signature *s = SigAlloc();
+ if (s == NULL)
+ return 0;
+
int result = 1;
result &= (DetectDceIfaceSetup(NULL, s, "12345678-1234-1234-1234-123456789ABC,>1,ay_frag") == -1);
if (de_ctx->sig_list == NULL)
goto end;
- result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSMDMATCH];
- if (sm != NULL) {
- DetectContentData *ud = sm->ctx;
- if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
+ if (sm == NULL) {
+ goto end;
+ }
+ DetectContentData *ud = sm->ctx;
+ if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
ud->fp_chop_offset == 0 &&
ud->fp_chop_len == 0) {
- result = 1;
- } else {
- result = 0;
- }
+ result = 1;
+ } else {
+ result = 0;
}
end:
if (de_ctx->sig_list == NULL)
goto end;
- result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSMDMATCH];
- if (sm != NULL) {
- DetectContentData *ud = sm->ctx;
- if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
+ if (sm == NULL) {
+ goto end;
+ }
+
+ DetectContentData *ud = sm->ctx;
+ if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
ud->fp_chop_offset == 3 &&
ud->fp_chop_len == 4) {
- result = 1;
- } else {
- result = 0;
- }
+ result = 1;
+ } else {
+ result = 0;
}
end:
DetectEngineCtxFree(de_ctx);
return result;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
int DetectFastPatternTest425(void)
{
if (de_ctx->sig_list == NULL)
goto end;
- result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
- if (sm != NULL) {
- DetectContentData *ud = sm->ctx;
- if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
+ if (sm == NULL) {
+ goto end;
+ }
+
+ DetectContentData *ud = sm->ctx;
+ if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
ud->fp_chop_offset == 0 &&
ud->fp_chop_len == 0) {
- result = 1;
- } else {
- result = 0;
- }
+ result = 1;
+ } else {
+ result = 0;
}
end:
if (de_ctx->sig_list == NULL)
goto end;
- result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
- if (sm != NULL) {
- DetectContentData *ud = sm->ctx;
- if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
+ if (sm == NULL) {
+ goto end;
+ }
+
+ DetectContentData *ud = sm->ctx;
+ if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
ud->fp_chop_offset == 3 &&
ud->fp_chop_len == 4) {
- result = 1;
- } else {
- result = 0;
- }
+ result = 1;
+ } else {
+ result = 0;
}
end:
return result;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
int DetectFastPatternTest466(void)
{
DetectEngineCtx *de_ctx = NULL;
if (de_ctx->sig_list == NULL)
goto end;
- result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
- if (sm != NULL) {
- DetectContentData *ud = sm->ctx;
- if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
+ if (sm == NULL) {
+ goto end;
+ }
+ DetectContentData *ud = sm->ctx;
+ if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
ud->fp_chop_offset == 0 &&
ud->fp_chop_len == 0) {
- result = 1;
- } else {
- result = 0;
- }
+ result = 1;
+ } else {
+ result = 0;
}
end:
if (de_ctx->sig_list == NULL)
goto end;
- result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
- if (sm != NULL) {
- DetectContentData *ud = sm->ctx;
- if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
+ if (sm == NULL) {
+ goto end;
+ }
+
+ DetectContentData *ud = sm->ctx;
+ if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
ud->fp_chop_offset == 3 &&
ud->fp_chop_len == 4) {
- result = 1;
- } else {
- result = 0;
- }
+ result = 1;
+ } else {
+ result = 0;
}
end:
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,=,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,=,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,+,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,+,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,-,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,-,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,==,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,==,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,!=,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar,!=,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, >,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, >,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, >= ,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, >= ,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, <= ,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, <= ,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, < ,35");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, < ,targetvar");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
DetectEngineCtx *de_ctx;
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
- goto error;
+ return 0;
de_ctx->flags |= DE_QUIET;
sfd = DetectFlowintParse(de_ctx, "myvar, isset");
DetectEngineCtxFree(de_ctx);
return result;
-error:
- if (de_ctx)
- DetectEngineCtxFree(de_ctx);
- return result;
}
/**
if (tx->request_method_number != M_GET ||
tx->request_protocol_number != HTTP_1_1)
{
- printf("expected method GET and got %s: , expected protocol "
- "HTTP/1.1 and got %s \n", bstr_tocstr(tx->request_method),
- bstr_tocstr(tx->request_protocol));
goto end;
}
if ((tx->parsed_uri->hostname == NULL) ||
(bstr_cmpc(tx->parsed_uri->hostname, "www.example.com") != 0))
{
- printf("expected www.example.com as hostname, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->hostname));
goto end;
}
if ((tx->parsed_uri->path == NULL) ||
(bstr_cmpc(tx->parsed_uri->path, "/images.gif") != 0))
{
- printf("expected /images.gif as path, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->path));
goto end;
}
if (tx->request_method_number != M_GET ||
tx->request_protocol_number != HTTP_1_1)
{
- printf("expected method GET and got %s: , expected protocol "
- "HTTP/1.1 and got %s \n", bstr_tocstr(tx->request_method),
- bstr_tocstr(tx->request_protocol));
goto end;
}
if ((tx->parsed_uri->hostname == NULL) ||
(bstr_cmpc(tx->parsed_uri->hostname, "www.example.com") != 0))
{
- printf("expected www.example.com as hostname, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->hostname));
goto end;
}
if ((tx->parsed_uri->path == NULL) ||
(bstr_cmpc(tx->parsed_uri->path, "/images.gif") != 0))
{
- printf("expected /images.gif as path, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->path));
goto end;
}
if (tx->request_method_number != M_UNKNOWN ||
tx->request_protocol_number != HTTP_1_1)
{
- printf("expected method GET and got %s: , expected protocol "
- "HTTP/1.1 and got %s \n", bstr_tocstr(tx->request_method),
- bstr_tocstr(tx->request_protocol));
goto end;
}
if ((tx->parsed_uri->hostname == NULL) ||
(bstr_cmpc(tx->parsed_uri->hostname, "www.example.com") != 0))
{
- printf("expected www.example.com as hostname, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->hostname));
goto end;
}
if ((tx->parsed_uri->path == NULL) ||
(bstr_cmpc(tx->parsed_uri->path, "/images.gif") != 0))
{
- printf("expected /images.gif as path, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->path));
goto end;
}
htp_state = f.alstate;
if (htp_state == NULL) {
printf("no http state: ");
- result = 0;
goto end;
}
if (tx->request_method_number != M_GET ||
tx->request_protocol_number != HTTP_1_1)
{
- printf("expected method GET and got %s: , expected protocol "
- "HTTP/1.1 and got %s \n", bstr_tocstr(tx->request_method),
- bstr_tocstr(tx->request_protocol));
- result = 0;
goto end;
}
if ((tx->parsed_uri->hostname == NULL) ||
(bstr_cmpc(tx->parsed_uri->hostname, "www.example.com") != 0))
{
- printf("expected www.example.com as hostname, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->hostname));
- result = 0;
goto end;
}
if ((tx->parsed_uri->path == NULL) ||
(bstr_cmpc(tx->parsed_uri->path, "/images.gif") != 0))
{
- printf("expected /images.gif as path, but got: %s \n",
- bstr_tocstr(tx->parsed_uri->path));
- result = 0;
goto end;
}
}
}
- if (arg1 != NULL)
- pcre_free_substring(arg1);
- if (arg2 != NULL)
- pcre_free_substring(arg2);
+ pcre_free_substring(arg1);
+ pcre_free_substring(arg2);
if (arg3 != NULL)
pcre_free_substring(arg3);
if (arg4 != NULL)
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 0;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
int result = 1;
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
int result = 0;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
int result = 0;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 0;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 1;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 1;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 1;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 1;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 1;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx;
int result = 1;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 1;
if (p1 == NULL)
return 0;
Packet *p2 = SCMalloc(SIZE_OF_PACKET);
- if (p2 == NULL)
+ if (p2 == NULL) {
+ SCFree(p1);
return 0;
+ }
ThreadVars th_v;
DetectEngineThreadCtx *det_ctx = NULL;
int result = 1;
str = SCStrdup("Hello1");
bzero(&servaddr, sizeof(servaddr));
- if (inet_pton(AF_INET, "0.0.0.0", &servaddr.sin_addr) <= 0)
+ if (inet_pton(AF_INET, "0.0.0.0", &servaddr.sin_addr) <= 0) {
+ SCFree(str);
return 0;
+ }
tmp = SCRadixAddKeyIPV4Netblock((uint8_t *)&servaddr.sin_addr, tree, str, 7);
if (!tmp) {
printf("Not inserted correctly 3 :");