Fix PyUnicode_Format(): return NULL if PyUnicode_READY(uformat) failed
This error cannot occur in practice: PyUnicode_FromObject() always return
a "ready" string.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 0da565a..87ac044 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13442,8 +13442,10 @@
uformat = PyUnicode_FromObject(format);
if (uformat == NULL)
return NULL;
- if (PyUnicode_READY(uformat) == -1)
+ if (PyUnicode_READY(uformat) == -1) {
Py_DECREF(uformat);
+ return NULL;
+ }
fmt = PyUnicode_DATA(uformat);
fmtkind = PyUnicode_KIND(uformat);