Fix error path so mutex is unlocked before returning

In the unusual case where ffi_trampoline_table_alloc() fails.
This commit is contained in:
Ole André Vadla Ravnås
2017-03-15 01:23:40 +01:00
parent dabbd14566
commit d42ce7b95c

View File

@@ -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;
}