Check for NULL return value in PyStructSequence_NewType(). Found by Coverity.

This commit is contained in:
Stefan Krah 2012-08-19 11:20:41 +02:00
parent 3c6661a914
commit 6b962860e2
1 changed files with 3 additions and 1 deletions

View File

@ -383,6 +383,8 @@ PyTypeObject*
PyStructSequence_NewType(PyStructSequence_Desc *desc)
{
PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
PyStructSequence_InitType(result, desc);
if (result != NULL) {
PyStructSequence_InitType(result, desc);
}
return result;
}