diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-13 12:24:50 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-13 12:24:50 (GMT) |
commit | 588544d186f35ce2d4881351c767954c5b3c4b4a (patch) | |
tree | 2175500985ee9aea279baff4c6811bd87a5ccf6c | |
parent | 7184366dab673f640bd0cb5eedc8643176300dff (diff) | |
download | cpython-588544d186f35ce2d4881351c767954c5b3c4b4a.zip cpython-588544d186f35ce2d4881351c767954c5b3c4b4a.tar.gz cpython-588544d186f35ce2d4881351c767954c5b3c4b4a.tar.bz2 |
Issue #19437: Fix GetKeepedObjects() of ctypes, handle PyCData_GetContainer()
failure
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 3744691..343d014 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -2344,7 +2344,11 @@ PyCData_GetContainer(CDataObject *self) static PyObject * GetKeepedObjects(CDataObject *target) { - return PyCData_GetContainer(target)->b_objects; + CDataObject *container; + container = PyCData_GetContainer(target); + if (container == NULL) + return NULL; + return container->b_objects; } static PyObject * |