Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b96286

Browse files
author
Stefan Krah
committed
Check for NULL return value in PyStructSequence_NewType(). Found by Coverity.
1 parent 3c6661a commit 6b96286

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Objects/structseq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ PyTypeObject*
383383
PyStructSequence_NewType(PyStructSequence_Desc *desc)
384384
{
385385
PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
386-
PyStructSequence_InitType(result, desc);
386+
if (result != NULL) {
387+
PyStructSequence_InitType(result, desc);
388+
}
387389
return result;
388390
}

0 commit comments

Comments
 (0)