girffi: Fix ffi_cif leaks on error return paths

Spotted by scan-build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #1767
This commit is contained in:
Philip Withnall 2024-04-12 15:51:39 +01:00
parent e45c93da79
commit 6162bccf1f
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -417,7 +417,7 @@ gi_callable_info_create_closure (GICallableInfo *callable_info,
if (status != FFI_OK)
{
g_warning ("ffi_prep_cif failed: %d", status);
ffi_closure_free (closure);
gi_callable_info_destroy_closure (callable_info, &closure->ffi_closure);
return NULL;
}
@ -425,7 +425,7 @@ gi_callable_info_create_closure (GICallableInfo *callable_info,
if (status != FFI_OK)
{
g_warning ("ffi_prep_closure failed: %d", status);
ffi_closure_free (closure);
gi_callable_info_destroy_closure (callable_info, &closure->ffi_closure);
return NULL;
}