summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-08-19 09:20:41 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-08-19 09:20:41 (GMT)
commit6b962860e2bd2d08d8d5d38969ed4864f8c1219a (patch)
treefdcfd915753978afde701647e0679fb33e6ff204 /Objects/structseq.c
parent3c6661a914af5bc91091dfd02c3cfb05c14bb641 (diff)
downloadcpython-6b962860e2bd2d08d8d5d38969ed4864f8c1219a.zip
cpython-6b962860e2bd2d08d8d5d38969ed4864f8c1219a.tar.gz
cpython-6b962860e2bd2d08d8d5d38969ed4864f8c1219a.tar.bz2
Check for NULL return value in PyStructSequence_NewType(). Found by Coverity.
Diffstat (limited to 'Objects/structseq.c')
-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;
}