Commits

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.

Comments (0)

Files changed (2)

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) {

pyobjc-core/Modules/objc/libffi_support.m

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