Kaydet (Commit) 2dd4abf2 authored tarafından Barry Warsaw's avatar Barry Warsaw

PyUnicode_AsUTF8String(): Don't need to explicitly incref str since

PyUnicode_EncodeUTF8() already returns the created object with the
proper reference count.  This fixes an Insure reported memory leak.
üst f087960e
...@@ -907,13 +907,9 @@ PyObject *PyUnicode_AsUTF8String(PyObject *unicode) ...@@ -907,13 +907,9 @@ PyObject *PyUnicode_AsUTF8String(PyObject *unicode)
PyErr_BadArgument(); PyErr_BadArgument();
return NULL; return NULL;
} }
str = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
PyUnicode_GET_SIZE(unicode), PyUnicode_GET_SIZE(unicode),
NULL); NULL);
if (str == NULL)
return NULL;
Py_INCREF(str);
return str;
} }
/* --- UTF-16 Codec ------------------------------------------------------- */ /* --- UTF-16 Codec ------------------------------------------------------- */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment