From ba6b430bd0732ee6ab731b3578d139827d24de80 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 17 May 2010 09:33:42 +0000 Subject: Fix refleak in internal_print() introduced by myself in r81251 _PyUnicode_AsDefaultEncodedString() uses a magical PyUnicode attribute to automatically destroy PyUnicode_EncodeUTF8() result when the unicode string is destroyed. --- Objects/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/object.c b/Objects/object.c index 1f4e3dd..7907a8e 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -311,6 +311,7 @@ internal_print(PyObject *op, FILE *fp, int flags, int nesting) else { fwrite(PyBytes_AS_STRING(t), 1, PyBytes_GET_SIZE(t), fp); + Py_DECREF(t); } } else { -- cgit v0.12