return 0;
}
ob = PyCData_GetContainer(target);
+ if (ob == NULL) {
+ Py_DECREF(keep);
+ return -1;
+ }
if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
Py_XDECREF(ob->b_objects);
ob->b_objects = keep; /* refcount consumed */
/* XXX */;
value = GetKeepedObjects(src);
+ if (value == NULL)
+ return NULL;
+
Py_INCREF(value);
return value;
}
*(void **)ptr = src->b_ptr;
keep = GetKeepedObjects(src);
+ if (keep == NULL)
+ return NULL;
+
/*
We are assigning an array object to a field which represents
a pointer. This has the same effect as converting an array
return -1;
keep = GetKeepedObjects(dst);
+ if (keep == NULL)
+ return -1;
+
Py_INCREF(keep);
return KeepRef(self, 0, keep);
}
*/
if (CDataObject_Check(src)) {
CDataObject *obj = (CDataObject *)src;
+ CDataObject *container;
+
/* PyCData_GetContainer will initialize src.b_objects, we need
this so it can be shared */
- PyCData_GetContainer(obj);
+ container = PyCData_GetContainer(obj);
+ if (container == NULL)
+ goto failed;
+
/* But we need a dictionary! */
if (obj->b_objects == Py_None) {
Py_DECREF(Py_None);