From 906bb770c8efe291cbf00c1e1c15b7a815a662cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Walter=20D=C3=B6rwald?= Date: Fri, 15 Aug 2003 16:27:32 +0000 Subject: [PATCH] Backport checkin: Fix another refcounting leak in PyUnicode_EncodeCharmap(). --- Objects/unicodeobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 */ -- 2.47.3