detect: do not exit on allocation failure during rule (re)load

Ticket: 6187
pull/14559/head
Philippe Antoine 7 months ago committed by Victor Julien
parent a0c91aa9f0
commit df812b7a90

@ -219,7 +219,7 @@ DetectContentData *DetectContentParse(SpmGlobalThreadCtx *spm_global_thread_ctx,
cd = SCCalloc(1, sizeof(DetectContentData) + len);
if (unlikely(cd == NULL)) {
SCFree(content);
exit(EXIT_FAILURE);
return NULL;
}
cd->content = (uint8_t *)cd + sizeof(DetectContentData);

@ -2289,7 +2289,7 @@ static DetectMatchAddressIPv4 *SigBuildAddressMatchArrayIPv4(
}
DetectMatchAddressIPv4 *addr_match4 = SCCalloc(cnt, sizeof(DetectMatchAddressIPv4));
if (addr_match4 == NULL) {
exit(EXIT_FAILURE);
return NULL;
}
uint16_t idx = 0;
@ -2315,7 +2315,7 @@ static DetectMatchAddressIPv6 *SigBuildAddressMatchArrayIPv6(
DetectMatchAddressIPv6 *addr_match6 = SCCalloc(cnt, sizeof(DetectMatchAddressIPv6));
if (addr_match6 == NULL) {
exit(EXIT_FAILURE);
return NULL;
}
uint16_t idx = 0;

Loading…
Cancel
Save