Fix for bug #626172: crash using unicode latin1 single char

Python 2.2.3 candidate.
This commit is contained in:
Marc-André Lemburg 2002-10-23 09:02:46 +00:00
parent 45186c4ce0
commit 9cd87aaa54
2 changed files with 7 additions and 3 deletions

View file

@ -4485,10 +4485,8 @@ int PyUnicode_Contains(PyObject *container,
goto onError;
}
u = (PyUnicodeObject *)PyUnicode_FromObject(container);
if (u == NULL) {
Py_DECREF(v);
if (u == NULL)
goto onError;
}
size = PyUnicode_GET_SIZE(v);
rhs = PyUnicode_AS_UNICODE(v);