Fix memory leak on error path in cxoObjectType_initialize (#422)
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
This commit is contained in:
parent
ca363bed8f
commit
528dec6859
@ -146,9 +146,11 @@ static int cxoObjectType_initialize(cxoObjectType *objType,
|
||||
}
|
||||
PyList_SET_ITEM(objType->attributes, i, (PyObject*) attr);
|
||||
if (PyDict_SetItem(objType->attributesByName, attr->name,
|
||||
(PyObject*) attr) < 0)
|
||||
(PyObject*) attr) < 0) {
|
||||
PyMem_Free(attributes);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
PyMem_Free(attributes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user