Skip to content

Commit

Permalink
Fix memory leak on error path in cxoObjectType_initialize (#422)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
  • Loading branch information
alexhenrie authored Apr 19, 2020
1 parent ca363be commit 528dec6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cxoObjectType.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ 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;
Expand Down

0 comments on commit 528dec6

Please sign in to comment.