]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix use of uninitialized scalar variable, see 3f994367a979
authorChristian Heimes <christian@cheimes.de>
Tue, 30 Jul 2013 23:33:50 +0000 (01:33 +0200)
committerChristian Heimes <christian@cheimes.de>
Tue, 30 Jul 2013 23:33:50 +0000 (01:33 +0200)
CID 1058763

Modules/_io/iobase.c

index a4f2c0e917d7b97380699365951180cc436f317b..ae188dd7fe2db375be6147b5c406f3d0d5adcc22 100644 (file)
@@ -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);