]> granicus.if.org Git - python/commitdiff
Fix refcount leak in the UnicodeError constructor:
authorWalter Dörwald <walter@livinglogic.de>
Thu, 14 Aug 2003 20:59:07 +0000 (20:59 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Thu, 14 Aug 2003 20:59:07 +0000 (20:59 +0000)
When parsing the constructor arguments failed, a
reference to the argument tuple was leaked.

Python/exceptions.c

index da78f2b19d3eac44ba0533294de5636c8176730d..d489aa6efbe1503651274848d6312f1e88d09c8e 100644 (file)
@@ -1191,7 +1191,7 @@ UnicodeError__init__(PyObject *self, PyObject *args, PyTypeObject *objecttype)
        &PyInt_Type, &start,
        &PyInt_Type, &end,
        &PyString_Type, &reason))
-       return NULL;
+       goto finally;
 
     if (PyObject_SetAttrString(self, "args", args))
        goto finally;