]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tevent: Fix a memleak on FreeBSD
authorVolker Lendecke <vl@samba.org>
Wed, 24 May 2017 14:21:40 +0000 (16:21 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 8 Jun 2017 18:38:19 +0000 (20:38 +0200)
FreeBSD has malloc'ed memory attached to mutexes. We need to clean this up.

valgrind really helped here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/tevent/tevent.c

index 7d59c8b1a83319169ebe85c34411a17bf473d6ac..f3b18a1527212104b696fc72c236a0e1870a9914 100644 (file)
@@ -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);