Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93b4b88

Browse files
committed
[Patch #974633] Check PyObject_MALLOC return for error
1 parent 6d3a0d2 commit 93b4b88

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ Yves Dionne
143143
Daniel Dittmar
144144
Walter D�rwald
145145
Jaromir Dolecek
146+
Dima Dorfman
146147
Cesar Douady
147148
Dean Draayer
148149
Fred L. Drake, Jr.

Parser/acceler.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ fixstate(grammar *g, state *s)
6969
int nl = g->g_ll.ll_nlabels;
7070
s->s_accept = 0;
7171
accel = (int *) PyObject_MALLOC(nl * sizeof(int));
72+
if (accel == NULL) {
73+
fprintf(stderr, "no mem to build parser accelerators\n");
74+
exit(1);
75+
}
7276
for (k = 0; k < nl; k++)
7377
accel[k] = -1;
7478
a = s->s_arc;

0 commit comments

Comments
 (0)