99 inline char * get_string(PyObject * uniobj) {
100 // TODO: re-evalutate if utf8 is always appropriate here.
101 PyObject *strobj = PyUnicode_AsEncodedString(uniobj, "UTF-8", "strict");
102 if (!strobj) return NULL;
when PyUnicodeUCS4_AsEncodedString() succeeds
'*strobj' was allocated at: PyObject *strobj = PyUnicode_AsEncodedString(uniobj, "UTF-8", "strict");
ob_refcnt is now refs: 1 owned
103 Py_INCREF(strobj);
taking False path
104 return PyBytes_AS_STRING(strobj);
ob_refcnt is now refs: 2 owned
105 }
memory leak: ob_refcnt of '*strobj' is 2 too high
was expecting final owned ob_refcnt of '*strobj' to be 0 since nothing references it but final ob_refcnt is refs: 2 owned
106