From 9b30f206ee6bbef7f591f1dda9ecd9a20c7ef7a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Walter=20D=C3=B6rwald?= Date: Fri, 15 Aug 2003 16:26:34 +0000 Subject: [PATCH] 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 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 */ -- 2.50.1