]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: illegal use of the malloc_trim() function if jemalloc is used
authorMiroslav Zagorac <mzagorac@haproxy.com>
Wed, 22 Mar 2023 11:52:19 +0000 (12:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Mar 2023 13:14:50 +0000 (14:14 +0100)
commitd8a97d8f60660c0d1adffe9a40ecce50d1e6b932
tree4d9232ef8d215db80a342d88dd36f00625b0fc45
parent9ef2742a514f66f728015a8ff9123b5f64b7d887
BUG/MINOR: illegal use of the malloc_trim() function if jemalloc is used

In the event that HAProxy is linked with the jemalloc library, it is still
shown that malloc_trim() is enabled when executing "haproxy -vv":
  ..
  Support for malloc_trim() is enabled.
  ..

It's not so much a problem as it is that malloc_trim() is called in the
pat_ref_purge_range() function without any checking.

This was solved by setting the using_default_allocator variable to the
correct value in the detect_allocator() function and before calling
malloc_trim() it is checked whether the function should be called.
include/haproxy/pool.h
src/pattern.c
src/pool.c