summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2004-06-29 14:03:04 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2004-06-29 14:03:04 (GMT)
commit93b4b88e960d5868ca2c0a109a74e1a8e06d3348 (patch)
treeeafaba5084ef21751f1135ce9f4b521ceb54f579 /Parser
parent6d3a0d2dffe06c1b4f0f445f3289da4c2a328355 (diff)
downloadcpython-93b4b88e960d5868ca2c0a109a74e1a8e06d3348.zip
cpython-93b4b88e960d5868ca2c0a109a74e1a8e06d3348.tar.gz
cpython-93b4b88e960d5868ca2c0a109a74e1a8e06d3348.tar.bz2
[Patch #974633] Check PyObject_MALLOC return for error
Diffstat (limited to 'Parser')
-rw-r--r--Parser/acceler.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Parser/acceler.c b/Parser/acceler.c
index 5f470fa..b41b265 100644
--- a/Parser/acceler.c
+++ b/Parser/acceler.c
@@ -69,6 +69,10 @@ fixstate(grammar *g, state *s)
int nl = g->g_ll.ll_nlabels;
s->s_accept = 0;
accel = (int *) PyObject_MALLOC(nl * sizeof(int));
+ if (accel == NULL) {
+ fprintf(stderr, "no mem to build parser accelerators\n");
+ exit(1);
+ }
for (k = 0; k < nl; k++)
accel[k] = -1;
a = s->s_arc;