From 00390ae27b6bd207add571d7975c37951e15a3e5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 24 May 2017 16:21:40 +0200 Subject: [PATCH] tevent: Fix a memleak on FreeBSD FreeBSD has malloc'ed memory attached to mutexes. We need to clean this up. valgrind really helped here Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/tevent/tevent.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c index 7d59c8b1a83..f3b18a15272 100644 --- a/lib/tevent/tevent.c +++ b/lib/tevent/tevent.c @@ -341,6 +341,11 @@ int tevent_common_context_destructor(struct tevent_context *ev) DLIST_REMOVE(ev->threaded_contexts, tctx); } + + ret = pthread_mutex_destroy(&ev->scheduled_mutex); + if (ret != 0) { + abort(); + } #endif tevent_common_wakeup_fini(ev); -- 2.11.4.GIT