From e9ee44c25b47e676b1b691cda5d75340b6f182fe Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Fri, 13 Jun 2008 06:00:46 +0000 Subject: [PATCH] Check for memory alloc failure --- Modules/_ctypes/callproc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index d2727e49ea1..b16d7b071a0 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1849,6 +1849,8 @@ buffer_info(PyObject *self, PyObject *arg) return NULL; } shape = PyTuple_New(dict->ndim); + if (shape == NULL) + return NULL; for (i = 0; i < (int)dict->ndim; ++i) PyTuple_SET_ITEM(shape, i, PyLong_FromSsize_t(dict->shape[i]));