summaryrefslogtreecommitdiffstats
path: root/Modules/_io/iobase.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-30 23:33:50 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-07-30 23:33:50 (GMT)
commit72f455e96cba2ce446aeb1a07aafa0a549a4a90d (patch)
tree039add6016fe66203d9578a8500f3fecc92c533a /Modules/_io/iobase.c
parent49e52f9375c23d88023344a6fd441fd2a4124dc6 (diff)
downloadcpython-72f455e96cba2ce446aeb1a07aafa0a549a4a90d.zip
cpython-72f455e96cba2ce446aeb1a07aafa0a549a4a90d.tar.gz
cpython-72f455e96cba2ce446aeb1a07aafa0a549a4a90d.tar.bz2
Fix use of uninitialized scalar variable, see 3f994367a979
CID 1058763
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r--Modules/_io/iobase.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index a4f2c0e..ae188dd 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -210,8 +210,10 @@ iobase_finalize(PyObject *self)
/* If `closed` doesn't exist or can't be evaluated as bool, then the
object is probably in an unusable state, so ignore. */
res = PyObject_GetAttr(self, _PyIO_str_closed);
- if (res == NULL)
+ if (res == NULL) {
PyErr_Clear();
+ closed = -1;
+ }
else {
closed = PyObject_IsTrue(res);
Py_DECREF(res);