On Mon, 02 Jan 2012 16:00:50 +0100 benjamin.peterson <python-check...@python.org> wrote: > http://hg.python.org/cpython/rev/d5cda62d0f8c > changeset: 74236:d5cda62d0f8c > user: Benjamin Peterson <benja...@python.org> > date: Mon Jan 02 09:00:30 2012 -0600 > summary: > fix some possible refleaks from PyUnicode_READY error conditions > > files: > Objects/unicodeobject.c | 80 ++++++++++++++++++++-------- > 1 files changed, 56 insertions(+), 24 deletions(-) > > > diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c > --- a/Objects/unicodeobject.c > +++ b/Objects/unicodeobject.c > @@ -9132,10 +9132,15 @@ > Py_ssize_t len1, len2; > > str_obj = PyUnicode_FromObject(str); > - if (!str_obj || PyUnicode_READY(str_obj) == -1) > + if (!str_obj) > return -1; > sub_obj = PyUnicode_FromObject(substr); > - if (!sub_obj || PyUnicode_READY(sub_obj) == -1) { > + if (!sub_obj) { > + Py_DECREF(str_obj); > + return -1; > + } > + if (PyUnicode_READY(substr) == -1 || PyUnicode_READY(str_obj) == -1) {
Shouldn't the first one be PyUnicode_READY(sub_obj) ? _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com