diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-08-19 09:20:41 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-08-19 09:20:41 (GMT) |
commit | 6b962860e2bd2d08d8d5d38969ed4864f8c1219a (patch) | |
tree | fdcfd915753978afde701647e0679fb33e6ff204 | |
parent | 3c6661a914af5bc91091dfd02c3cfb05c14bb641 (diff) | |
download | cpython-6b962860e2bd2d08d8d5d38969ed4864f8c1219a.zip cpython-6b962860e2bd2d08d8d5d38969ed4864f8c1219a.tar.gz cpython-6b962860e2bd2d08d8d5d38969ed4864f8c1219a.tar.bz2 |
Check for NULL return value in PyStructSequence_NewType(). Found by Coverity.
-rw-r--r-- | Objects/structseq.c | 4 |
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; } |