cppcheck: fix possible null deref and unused structs
[m6w6/ext-psi] / src / libffi.c
index 5dce76bb4e921932a50c539691da7ac810c599f0..8cf29ddbd7dc445c29b302e6fbc1c48cab1d47b2 100644 (file)
@@ -449,12 +449,12 @@ static zend_function_entry *psi_ffi_compile(struct psi_context *C)
                if (!impl->decl) {
                        continue;
                }
-
-               if ((call = psi_ffi_call_alloc(C, impl->decl))) {
-                       if (FFI_OK != psi_ffi_call_init_closure(C, call, impl)) {
-                               psi_ffi_call_free(call);
-                               continue;
-                       }
+               if (!(call = psi_ffi_call_alloc(C, impl->decl))) {
+                       continue;
+               }
+               if (FFI_OK != psi_ffi_call_init_closure(C, call, impl)) {
+                       psi_ffi_call_free(call);
+                       continue;
                }
 
                zf->fname = impl->func->name + (impl->func->name[0] == '\\');