summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-06-13 06:00:46 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2008-06-13 06:00:46 +0000
commite9ee44c25b47e676b1b691cda5d75340b6f182fe (patch)
tree5344773fc5b10568fbf46e813291f494302551af
parenta4dd2e20e2302cc41a027cae5d0057dc2dff2ba6 (diff)
downloadcpython-git-e9ee44c25b47e676b1b691cda5d75340b6f182fe.tar.gz
Check for memory alloc failure
-rw-r--r--Modules/_ctypes/callproc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index d2727e49ea..b16d7b071a 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]));