]> granicus.if.org Git - python/commitdiff
Fix another refcounting leak in PyUnicode_EncodeCharmap().
authorWalter Dörwald <walter@livinglogic.de>
Fri, 15 Aug 2003 16:26:34 +0000 (16:26 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Fri, 15 Aug 2003 16:26:34 +0000 (16:26 +0000)
Objects/unicodeobject.c

index 694c17402233a0f65724f1ac4e7f9714e72ba978..c56ef9fa27f7e01e4785b91294335dc869c657bd 100644 (file)
@@ -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 */