Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1857·libevent

Leak when using libevent and pthread

Author: psnchzCreated Apr 13, 2026Updated May 25, 2026

Hello,

I found a leak when the function evthread_use_pthreads is used. This function call evthread_use_pthreads_with_flags and then pthread_mutexattr_init 2 times.

pthread_mutexattr_init seems to allocate 20 bytes that need to be freed with pthread_mutexattr_destroy when not longer used.

This is not a big problem but still a leak.

Source: libevent/libevent

View original on GitHubView discussion on GitHub