diff options
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 */ |