Welcome! Log In Create A New Profile

Advanced

[PATCH] BUG/MINOR: thread: log: Log buffers allocated twice by main, thread.

Posted by Frederic Lecaille 
This is a patch to fix a very minor bug. But at least it helps in making
reg tests with the address sanitizer passes.

Fred.
Le 11/07/2018 à 10:48, Frederic Lecaille a écrit :
> This is a patch to fix a very minor bug. But at least it helps in making
> reg tests with the address sanitizer passes.
>

Hi Fred,

There is no leak here because realloc is used (using my_realloc2
wrapper). And in fact, it is important to call it twice. The first time,
with the default value for global.max_syslog_len, to allow logging
during the configuration parsing. The second time, after the
configuration parsing to eventually resize the log buffers using the
right value for global.max_syslog_len (deduced from the configuration).

Note that only the main thread will do the first allocation. The others
will only do the second one because they are created after the
configuration parsing.

--
Christopher Faulet
Sorry, only registered users may post in this forum.

Click here to login