diff Objects/unicodeobject.c @ 30163:29b1d0763790 2.3

Backport checkin: Fix another refcounting leak in PyUnicode_EncodeCharmap().
author Walter Dörwald <walter@livinglogic.de>
date Fri, 15 Aug 2003 16:27:32 +0000
parents 54617ed2d830
children 7cb4ad5932e6
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Fri Aug 15 15:01:26 2003 +0000
+++ b/Objects/unicodeobject.c	Fri Aug 15 16:27:32 2003 +0000
@@ -3027,8 +3027,10 @@
 	    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 */