Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80b331c commit 6ce7d1eCopy full SHA for 6ce7d1e
1 file changed
Objects/stringobject.c
@@ -4780,10 +4780,13 @@ PyString_Format(PyObject *format, PyObject *args)
4780
reslen += rescnt;
4781
if (reslen < 0) {
4782
Py_DECREF(result);
4783
+ Py_XDECREF(temp);
4784
return PyErr_NoMemory();
4785
}
- if (_PyString_Resize(&result, reslen) < 0)
4786
+ if (_PyString_Resize(&result, reslen) < 0) {
4787
4788
return NULL;
4789
+ }
4790
res = PyString_AS_STRING(result)
4791
+ reslen - rescnt;
4792
@@ -4834,6 +4837,7 @@ PyString_Format(PyObject *format, PyObject *args)
4834
4837
if (dict && (argidx < arglen) && c != '%') {
4835
4838
PyErr_SetString(PyExc_TypeError,
4836
4839
"not all arguments converted during string formatting");
4840
4841
goto error;
4842
4843
Py_XDECREF(temp);
0 commit comments