From: Aki Tuomi Date: Mon, 2 Sep 2024 07:23:15 +0000 (+0300) Subject: lib: event-filter - Use system pool for memory X-Git-Tag: 2.4.0~341 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b834df09d15b48e97bdfbc87a17349efe531d45c;p=thirdparty%2Fdovecot%2Fcore.git lib: event-filter - Use system pool for memory --- diff --git a/src/lib/event-filter-lexer.l b/src/lib/event-filter-lexer.l index 8c28400a02..be78d4acc0 100644 --- a/src/lib/event-filter-lexer.l +++ b/src/lib/event-filter-lexer.l @@ -98,27 +98,17 @@ static size_t event_filter_parser_input_proc(char *buf, size_t size, yyscan_t sc void *yyalloc(size_t bytes, void* yyscanner ATTR_UNUSED) { - void *ptr = calloc(1, bytes); - if (ptr == NULL) - i_fatal_status(FATAL_OUTOFMEM, "calloc(1, %zu): Out of memory", - bytes); - return ptr; + return i_malloc(bytes); } void *yyrealloc (void *ptr, size_t bytes, void *yyscanner ATTR_UNUSED) { - void *nptr = realloc(ptr, bytes); - if (nptr == NULL) - i_fatal_status(FATAL_OUTOFMEM, "realloc(ptr, %zu): Out of memory", - bytes); - return nptr; + return i_realloc(ptr, SIZE_MAX, bytes); } void yyfree(void *ptr, void *yyscanner ATTR_UNUSED) { - if (ptr == NULL) - return; - free(ptr); + i_free(ptr); } static size_t event_filter_parser_input_proc(char *buf, size_t size, yyscan_t scanner)