Kaydet (Commit) 93b4b88e authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

[Patch #974633] Check PyObject_MALLOC return for error

üst 6d3a0d2d
...@@ -143,6 +143,7 @@ Yves Dionne ...@@ -143,6 +143,7 @@ Yves Dionne
Daniel Dittmar Daniel Dittmar
Walter Drwald Walter Drwald
Jaromir Dolecek Jaromir Dolecek
Dima Dorfman
Cesar Douady Cesar Douady
Dean Draayer Dean Draayer
Fred L. Drake, Jr. Fred L. Drake, Jr.
......
...@@ -69,6 +69,10 @@ fixstate(grammar *g, state *s) ...@@ -69,6 +69,10 @@ fixstate(grammar *g, state *s)
int nl = g->g_ll.ll_nlabels; int nl = g->g_ll.ll_nlabels;
s->s_accept = 0; s->s_accept = 0;
accel = (int *) PyObject_MALLOC(nl * sizeof(int)); 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++) for (k = 0; k < nl; k++)
accel[k] = -1; accel[k] = -1;
a = s->s_arc; a = s->s_arc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment