diff Objects/unicodeobject.c @ 30162:443533d08783 legacy-trunk

Fix another refcounting leak in PyUnicode_EncodeCharmap().
author Walter Dörwald <walter@livinglogic.de>
date Fri, 15 Aug 2003 16:26:34 +0000
parents 3329b058db20
children 7cb4ad5932e6
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Fri Aug 15 15:00:26 2003 +0000
+++ b/Objects/unicodeobject.c	Fri Aug 15 16:26:34 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 */