Ronald Oussoren  committed 5ea5ea1

Small bugfix in error-handling path

Function.m did not initialize the cif field to NULL, causes
crash when setup fails before the cif is created.
Libffi_support.m forgot to free result in an error path.

  • Participants
  • Parent commits fc506bc
  • Branches default

Comments (0)

Files changed (2)

File pyobjc-core/Modules/objc/function.m

 	result->doc = NULL;
 	result->name = NULL;
 	result->module = NULL;
+	result->cif = NULL;
 	result->methinfo= PyObjCMethodSignature_WithMetaData(signature, meta, NO);
 	if (result->methinfo == NULL) {

File pyobjc-core/Modules/objc/libffi_support.m

 		cl_ret_type, cl_arg_types);
 	if (rv != FFI_OK) {
+		PyMem_Free(cif);
 			"Cannot create FFI CIF: err=%d", rv);