Skip to content

Stop leaking mutex in nmworker and cond in nm socket

Ondřej Surý requested to merge 3051-missing-destroy-for-pthread-primitives into main

On FreeBSD, the pthread primitives are not solely allocated on stack, but part of the object lives on the heap. Missing pthread_*_destroy causes the heap memory to grow and in case of fast lived object it's possible to run out-of-memory.

Properly destroy the leaking mutex (worker->lock) and the leaking condition (sock->cond).

Closes #3051 (closed)

Edited by Ondřej Surý

Merge request reports