From: Ross Lagerwall Date: Sat, 7 Apr 2012 05:09:57 +0000 (+0200) Subject: Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder. X-Git-Tag: v3.3.0a3~294^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f9eec19ee1652a61d4b2e860e599c617d88b707;p=python Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder. Found with Clang's Static Analyzer. --- diff --git a/Misc/NEWS b/Misc/NEWS index b4a0091276..29bf33a9b8 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -19,6 +19,8 @@ Core and Builtins Library ------- +- Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder. + - Issue #8515: Set __file__ when run file in IDLE. Initial patch by Bruce Frederiksen. diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 833a527639..ae105e53cc 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -460,7 +460,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self, output = PyUnicode_FromKindAndData(kind, translated, out); PyMem_Free(translated); if (!output) - goto error; + return NULL; } self->seennl |= seennl; }