]> granicus.if.org Git - python/commitdiff
Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
authorRoss Lagerwall <rosslagerwall@gmail.com>
Sat, 7 Apr 2012 05:09:57 +0000 (07:09 +0200)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Sat, 7 Apr 2012 05:09:57 +0000 (07:09 +0200)
Found with Clang's Static Analyzer.

Misc/NEWS
Modules/_io/textio.c

index b4a00912761860bf60df72a3347141a31b5f95ce..29bf33a9b857a5583027ed99b5a287ba436ae56d 100644 (file)
--- 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.
 
index 833a52763961d17a1ab1f11ebadc9d10285d7a58..ae105e53cc536451ca99232cac9cd1eda07657f8 100644 (file)
@@ -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;
     }