summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-10-19 00:40:16 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-10-19 00:40:16 (GMT)
commitc548660af5b06f4bfd9da27150cfbd4f7330f732 (patch)
treee4cd4866837a60c213a0627be2685e0cd6a51b15
parent355491dc47ea4a2574ee8f9ea60a0d25fe3fba43 (diff)
downloadcpython-c548660af5b06f4bfd9da27150cfbd4f7330f732.zip
cpython-c548660af5b06f4bfd9da27150cfbd4f7330f732.tar.gz
cpython-c548660af5b06f4bfd9da27150cfbd4f7330f732.tar.bz2
Issue #16742: My fix on PyOS_StdioReadline() was incomplete, PyMem_FREE() was
not patched
-rw-r--r--Parser/myreadline.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 562494e..8bb35bd 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -140,13 +140,13 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
while (n > 0 && p[n-1] != '\n') {
size_t incr = n+2;
if (incr > INT_MAX) {
- PyMem_FREE(p);
+ PyMem_RawFree(p);
PyErr_SetString(PyExc_OverflowError, "input line too long");
return NULL;
}
pr = (char *)PyMem_RawRealloc(p, n + incr);
if (pr == NULL) {
- PyMem_FREE(p);
+ PyMem_RawFree(p);
PyErr_NoMemory();
return NULL;
}
@@ -157,7 +157,7 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
}
pr = (char *)PyMem_RawRealloc(p, n+1);
if (pr == NULL) {
- PyMem_FREE(p);
+ PyMem_RawFree(p);
PyErr_NoMemory();
return NULL;
}