mirror of
https://github.com/python/cpython.git
synced 2026-04-25 21:30:45 +00:00
bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015) (GH-11020)
(cherry picked from commit 4c49da0cb7)
This commit is contained in:
parent
2db190bb35
commit
602d307ac5
16 changed files with 109 additions and 24 deletions
|
|
@ -689,11 +689,12 @@ r_string(Py_ssize_t n, RFILE *p)
|
|||
p->buf_size = n;
|
||||
}
|
||||
else if (p->buf_size < n) {
|
||||
p->buf = PyMem_REALLOC(p->buf, n);
|
||||
if (p->buf == NULL) {
|
||||
char *tmp = PyMem_REALLOC(p->buf, n);
|
||||
if (tmp == NULL) {
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
p->buf = tmp;
|
||||
p->buf_size = n;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue