From 93b4b88e960d5868ca2c0a109a74e1a8e06d3348 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Tue, 29 Jun 2004 14:03:04 +0000 Subject: [PATCH] [Patch #974633] Check PyObject_MALLOC return for error --- Misc/ACKS | 1 + Parser/acceler.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Misc/ACKS b/Misc/ACKS index a54c46674e8..b6e4da42eba 100644 --- 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. diff --git a/Parser/acceler.c b/Parser/acceler.c index 5f470fa086a..b41b2654f4e 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;