]> granicus.if.org Git - python/commitdiff
[Patch #974633] Check PyObject_MALLOC return for error
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 29 Jun 2004 14:03:04 +0000 (14:03 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 29 Jun 2004 14:03:04 +0000 (14:03 +0000)
Misc/ACKS
Parser/acceler.c

index a54c46674e8991d95fdde26e5f07c19dd7bcb671..b6e4da42eba8e51ee0ea6eb7238708184eae69b8 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -143,6 +143,7 @@ Yves Dionne
 Daniel Dittmar
 Walter Dörwald
 Jaromir Dolecek
+Dima Dorfman
 Cesar Douady
 Dean Draayer
 Fred L. Drake, Jr.
index 5f470fa086ab8cc0f82db7b3fdcd9548ab21f7e0..b41b2654f4e0b156f8159e12c8eaee47784db9f1 100644 (file)
@@ -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;