Skip to content

Commit df812b7

Browse files
catenacybervictorjulien
authored andcommitted
detect: do not exit on allocation failure during rule (re)load
Ticket: 6187
1 parent a0c91aa commit df812b7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/detect-content.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ DetectContentData *DetectContentParse(SpmGlobalThreadCtx *spm_global_thread_ctx,
219219
cd = SCCalloc(1, sizeof(DetectContentData) + len);
220220
if (unlikely(cd == NULL)) {
221221
SCFree(content);
222-
exit(EXIT_FAILURE);
222+
return NULL;
223223
}
224224

225225
cd->content = (uint8_t *)cd + sizeof(DetectContentData);

src/detect-parse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ static DetectMatchAddressIPv4 *SigBuildAddressMatchArrayIPv4(
22892289
}
22902290
DetectMatchAddressIPv4 *addr_match4 = SCCalloc(cnt, sizeof(DetectMatchAddressIPv4));
22912291
if (addr_match4 == NULL) {
2292-
exit(EXIT_FAILURE);
2292+
return NULL;
22932293
}
22942294

22952295
uint16_t idx = 0;
@@ -2315,7 +2315,7 @@ static DetectMatchAddressIPv6 *SigBuildAddressMatchArrayIPv6(
23152315

23162316
DetectMatchAddressIPv6 *addr_match6 = SCCalloc(cnt, sizeof(DetectMatchAddressIPv6));
23172317
if (addr_match6 == NULL) {
2318-
exit(EXIT_FAILURE);
2318+
return NULL;
23192319
}
23202320

23212321
uint16_t idx = 0;

0 commit comments

Comments
 (0)