]> granicus.if.org Git - python/commitdiff
Sf patch #700047: unicode object leaks refcount on resizing
authorRaymond Hettinger <python@rcn.com>
Sun, 9 Mar 2003 07:30:43 +0000 (07:30 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 9 Mar 2003 07:30:43 +0000 (07:30 +0000)
Contributed by Hye-Shik Chang.

Objects/unicodeobject.c

index 14318f67d3da721f0e0e7461cfe509f48c24f770..dcfde347c3dce17507a39aa790ddb9c4deda30d4 100644 (file)
@@ -276,6 +276,7 @@ int PyUnicode_Resize(PyObject **unicode,
            return -1;
        Py_UNICODE_COPY(w->str, v->str,
                        length < v->length ? length : v->length);
+       Py_DECREF(*unicode);
        *unicode = (PyObject *)w;
        return 0;
     }