From eb85f5b5481ee957ca87745e8e45b9e8c638e621 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sat, 12 Aug 2006 01:43:40 +0000 Subject: Klocwork made another run and found a bunch more problems. This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree). --- Objects/structseq.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Objects/structseq.c') diff --git a/Objects/structseq.c b/Objects/structseq.c index e074810df3..7ac2a1f61e 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -215,6 +215,8 @@ structseq_contains(PyStructSequence *obj, PyObject *o) PyObject *tup; int result; tup = make_tuple(obj); + if (!tup) + return -1; result = PySequence_Contains(tup, o); Py_DECREF(tup); return result; @@ -226,6 +228,8 @@ structseq_hash(PyObject *obj) PyObject *tup; long result; tup = make_tuple((PyStructSequence*) obj); + if (!tup) + return -1; result = PyObject_Hash(tup); Py_DECREF(tup); return result; -- cgit v1.2.1