Re: pthread_once fix memory leak

2021-05-02 Thread Otto Moerbeek
On Sun, May 02, 2021 at 02:07:21PM +0200, Mark Kettenis wrote: > > From: Martijn van Duren > > Date: Sun, 02 May 2021 13:28:10 +0200 > > > > Found this while tracing a memory leak in filter-dkimsign, thanks to > > libcrypto. The mutex in pthread_once_t is never destroyed, so the > > memory

Re: pthread_once fix memory leak

2021-05-02 Thread Mark Kettenis
> From: Martijn van Duren > Date: Sun, 02 May 2021 13:28:10 +0200 > > Found this while tracing a memory leak in filter-dkimsign, thanks to > libcrypto. The mutex in pthread_once_t is never destroyed, so the > memory allocated inside the mutex is never released. > > The diff below was inspired

pthread_once fix memory leak

2021-05-02 Thread Martijn van Duren
Found this while tracing a memory leak in filter-dkimsign, thanks to libcrypto. The mutex in pthread_once_t is never destroyed, so the memory allocated inside the mutex is never released. The diff below was inspired by Ed Schouten and switches form mutex to futex to prevent any memory allocation.