Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 72f455e

Browse files
committed
Fix use of uninitialized scalar variable, see 3f994367a979
CID 1058763
1 parent 49e52f9 commit 72f455e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/_io/iobase.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ iobase_finalize(PyObject *self)
210210
/* If `closed` doesn't exist or can't be evaluated as bool, then the
211211
object is probably in an unusable state, so ignore. */
212212
res = PyObject_GetAttr(self, _PyIO_str_closed);
213-
if (res == NULL)
213+
if (res == NULL) {
214214
PyErr_Clear();
215+
closed = -1;
216+
}
215217
else {
216218
closed = PyObject_IsTrue(res);
217219
Py_DECREF(res);

0 commit comments

Comments
 (0)