From: Walter Dörwald Date: Fri, 15 Aug 2003 16:27:32 +0000 (+0000) Subject: Backport checkin: X-Git-Tag: v2.3.1~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=906bb770c8efe291cbf00c1e1c15b7a815a662cc;p=thirdparty%2FPython%2Fcpython.git Backport checkin: Fix another refcounting leak in PyUnicode_EncodeCharmap(). --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 694c17402233..c56ef9fa27f7 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3027,8 +3027,10 @@ PyObject *PyUnicode_EncodeCharmap(const Py_UNICODE *p, if (charmap_encoding_error(p, size, &inpos, mapping, &exc, &known_errorHandler, &errorHandler, errors, - &res, &respos)) + &res, &respos)) { + Py_DECREF(x); goto onError; + } } else /* done with this character => adjust input position */