summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-04-21 21:24:33 +0200
committerLennart Poettering <lennart@poettering.net>2009-04-21 21:24:33 +0200
commitb304a98854697b9287f24027d55decbd0d2e296b (patch)
treed7e82d27b384aa6de8d811bb6573cb5ee85b2c96
parent12065f326ab62b396cbcbca3c5fd9e7d66162da2 (diff)
mutex: when we fail to fill in mutex into static mutex ptr free it again
-rw-r--r--src/pulsecore/mutex-posix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pulsecore/mutex-posix.c b/src/pulsecore/mutex-posix.c
index b3e5256a..0ff4bee6 100644
--- a/src/pulsecore/mutex-posix.c
+++ b/src/pulsecore/mutex-posix.c
@@ -153,6 +153,8 @@ pa_mutex* pa_static_mutex_get(pa_static_mutex *s, pa_bool_t recursive, pa_bool_t
if ((pa_atomic_ptr_cmpxchg(&s->ptr, NULL, m)))
return m;
+ pa_mutex_free(m);
+
/* Him, filling in failed, so someone else must have filled in
* already */
pa_assert_se(m = pa_atomic_ptr_load(&s->ptr));