summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2003-08-15 16:26:34 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2003-08-15 16:26:34 (GMT)
commit9b30f206ee6bbef7f591f1dda9ecd9a20c7ef7a5 (patch)
treec568771f2900aa5f15baadb160f3478a5fa19ed6
parentd4ade0885c9a1bf7013b555c93060e0126bfa7eb (diff)
downloadcpython-9b30f206ee6bbef7f591f1dda9ecd9a20c7ef7a5.zip
cpython-9b30f206ee6bbef7f591f1dda9ecd9a20c7ef7a5.tar.gz
cpython-9b30f206ee6bbef7f591f1dda9ecd9a20c7ef7a5.tar.bz2
Fix another refcounting leak in PyUnicode_EncodeCharmap().
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 694c174..c56ef9f 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 */