summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c5
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;
}