From: Walter Dörwald Date: Fri, 15 Aug 2003 16:26:34 +0000 (+0000) Subject: Fix another refcounting leak in PyUnicode_EncodeCharmap(). X-Git-Tag: v2.4a1~1734 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b30f206ee6bbef7f591f1dda9ecd9a20c7ef7a5;p=python Fix another refcounting leak in PyUnicode_EncodeCharmap(). --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 694c174022..c56ef9fa27 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 */