]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: event-filter - Use system pool for memory
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 2 Sep 2024 07:23:15 +0000 (10:23 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:00 +0000 (10:40 +0200)
src/lib/event-filter-lexer.l

index 8c28400a02ec0ebd3e4e8e0b9830774db590570f..be78d4acc0ab0ef7653b79c9b177fc55001cf59a 100644 (file)
@@ -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)