From: Walter Dörwald Date: Tue, 4 Feb 2003 16:57:49 +0000 (+0000) Subject: PyUnicode_Resize() doesn't free its argument in case of a failure, X-Git-Tag: v2.3c1~2047 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=531e000d2e6c15b7a83018d8c663770c012ee98e;p=thirdparty%2FPython%2Fcpython.git PyUnicode_Resize() doesn't free its argument in case of a failure, so we can jump to the error handling code that does. (Spotted by Neal Norwitz) --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index c273012aa11c..2383b4fdd072 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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; }