From: Victor Stinner Date: Mon, 17 May 2010 09:33:42 +0000 (+0000) Subject: Fix refleak in internal_print() introduced by myself in r81251 X-Git-Tag: v3.2a1~776 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba6b430bd0732ee6ab731b3578d139827d24de80;p=python 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. --- diff --git a/Objects/object.c b/Objects/object.c index 1f4e3dd445..7907a8e566 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 {