]> granicus.if.org Git - python/commitdiff
PyUnicode_Resize() doesn't free its argument in case of a failure,
authorWalter Dörwald <walter@livinglogic.de>
Tue, 4 Feb 2003 16:57:49 +0000 (16:57 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Tue, 4 Feb 2003 16:57:49 +0000 (16:57 +0000)
so we can jump to the error handling code that does.
(Spotted by Neal Norwitz)

Python/bltinmodule.c

index c273012aa11c3a0b29073a7596c03ce4c2d17cf2..2383b4fdd072ffc1296d0639822ef1e24352a28e 100644 (file)
@@ -2028,7 +2028,7 @@ filterunicode(PyObject *func, PyObject *strobj)
                                                need = 2*outlen;
                                        if (PyUnicode_Resize(&result, need)) {
                                                Py_DECREF(item);
-                                               return NULL;
+                                               goto Fail_1;
                                        }
                                        outlen = need;
                                }