Commit 758153ba authored by Antoine Pitrou's avatar Antoine Pitrou

Fix refleaks introduced by 83da67651687.

parent e45c0c5c
...@@ -9079,8 +9079,11 @@ PyUnicode_Count(PyObject *str, ...@@ -9079,8 +9079,11 @@ PyUnicode_Count(PyObject *str,
buf1 = PyUnicode_DATA(str_obj); buf1 = PyUnicode_DATA(str_obj);
buf2 = PyUnicode_DATA(sub_obj); buf2 = PyUnicode_DATA(sub_obj);
if (kind2 != kind) { if (kind2 != kind) {
if (kind2 > kind) if (kind2 > kind) {
Py_DECREF(sub_obj);
Py_DECREF(str_obj);
return 0; return 0;
}
buf2 = _PyUnicode_AsKind(sub_obj, kind); buf2 = _PyUnicode_AsKind(sub_obj, kind);
} }
if (!buf2) if (!buf2)
...@@ -10659,8 +10662,11 @@ PyUnicode_Contains(PyObject *container, PyObject *element) ...@@ -10659,8 +10662,11 @@ PyUnicode_Contains(PyObject *container, PyObject *element)
buf1 = PyUnicode_DATA(str); buf1 = PyUnicode_DATA(str);
buf2 = PyUnicode_DATA(sub); buf2 = PyUnicode_DATA(sub);
if (kind2 != kind) { if (kind2 != kind) {
if (kind2 > kind) if (kind2 > kind) {
Py_DECREF(sub);
Py_DECREF(str);
return 0; return 0;
}
buf2 = _PyUnicode_AsKind(sub, kind); buf2 = _PyUnicode_AsKind(sub, kind);
} }
if (!buf2) { if (!buf2) {
......
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