Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba6b430

Browse files
author
Victor Stinner
committed
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.
1 parent e9fb319 commit ba6b430

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Objects/object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ internal_print(PyObject *op, FILE *fp, int flags, int nesting)
311311
else {
312312
fwrite(PyBytes_AS_STRING(t), 1,
313313
PyBytes_GET_SIZE(t), fp);
314+
Py_DECREF(t);
314315
}
315316
}
316317
else {

0 commit comments

Comments
 (0)