Commit 6b962860 authored by Stefan Krah's avatar Stefan Krah

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

parent 3c6661a9
...@@ -383,6 +383,8 @@ PyTypeObject* ...@@ -383,6 +383,8 @@ PyTypeObject*
PyStructSequence_NewType(PyStructSequence_Desc *desc) PyStructSequence_NewType(PyStructSequence_Desc *desc)
{ {
PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0); PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
if (result != NULL) {
PyStructSequence_InitType(result, desc); PyStructSequence_InitType(result, desc);
}
return result; return result;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment