Serhiy Storchaka added the comment: Rather rare reference leak is not the worst bug here.
Following example const char *s = ...; PyObject *b = PyBytes_New(...); return PyBuildValue("(Ns)s", b, s, PyBytes_AS_STRING(b)); works if s is correct UTF-8 encoded string. But if it is not correct UTF-8 encoded string, the first "s" is failed and the inner tuple is deallocated together with the borrowed reference to b. The second "s" then reads freed memory. ---------- type: resource usage -> crash _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26168> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com