diff options
Diffstat (limited to 'Python/marshal.c')
-rw-r--r-- | Python/marshal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index 21cdd60..52932af 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -670,11 +670,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; } |