From: Victor Stinner Date: Wed, 13 Nov 2013 12:23:35 +0000 (+0100) Subject: Issue #19437: Fix PyCData_GetContainer() of ctypes, handle PyDict_New() failure X-Git-Tag: v3.4.0b1~296 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7184366dab673f640bd0cb5eedc8643176300dff;p=thirdparty%2FPython%2Fcpython.git Issue #19437: Fix PyCData_GetContainer() of ctypes, handle PyDict_New() failure --- diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 0deffa0a9f1d..3744691f920c 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -2331,6 +2331,8 @@ PyCData_GetContainer(CDataObject *self) if (self->b_objects == NULL) { if (self->b_length) { self->b_objects = PyDict_New(); + if (self->b_objects == NULL) + return NULL; } else { Py_INCREF(Py_None); self->b_objects = Py_None;