From d42ce7b95c6d5cba7d976cc0c8c85f7645fa6b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Wed, 15 Mar 2017 01:23:40 +0100 Subject: [PATCH] Fix error path so mutex is unlocked before returning In the unusual case where ffi_trampoline_table_alloc() fails. --- src/closures.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/closures.c b/src/closures.c index 2e0ffb45..78d6aeb6 100644 --- a/src/closures.c +++ b/src/closures.c @@ -211,6 +211,7 @@ ffi_closure_alloc (size_t size, void **code) table = ffi_trampoline_table_alloc (); if (table == NULL) { + pthread_mutex_unlock (&ffi_trampoline_lock); free (closure); return NULL; }