summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/structseq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 28cbb19..c3b9a72 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -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;
}