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

Skip to content

Commit 0f9eec1

Browse files
committed
Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
Found with Clang's Static Analyzer.
1 parent c1b34a3 commit 0f9eec1

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Core and Builtins
1919
Library
2020
-------
2121

22+
- Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
23+
2224
- Issue #8515: Set __file__ when run file in IDLE.
2325
Initial patch by Bruce Frederiksen.
2426

Modules/_io/textio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
460460
output = PyUnicode_FromKindAndData(kind, translated, out);
461461
PyMem_Free(translated);
462462
if (!output)
463-
goto error;
463+
return NULL;
464464
}
465465
self->seennl |= seennl;
466466
}

0 commit comments

Comments
 (0)