Fix error path so mutex is unlocked before returning
In the unusual case where ffi_trampoline_table_alloc() fails.
This commit is contained in:
@@ -211,6 +211,7 @@ ffi_closure_alloc (size_t size, void **code)
|
|||||||
table = ffi_trampoline_table_alloc ();
|
table = ffi_trampoline_table_alloc ();
|
||||||
if (table == NULL)
|
if (table == NULL)
|
||||||
{
|
{
|
||||||
|
pthread_mutex_unlock (&ffi_trampoline_lock);
|
||||||
free (closure);
|
free (closure);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user