Mercurial > cpython-lru_cache-weakref
changeset 87081:dc5ae99bc605
Issue #19437: Fix GetKeepedObjects() of ctypes, handle PyCData_GetContainer()
failure
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Wed, 13 Nov 2013 13:24:50 +0100 |
| parents | a217ea1671a8 |
| children | 13203ea0ac5b |
| files | Modules/_ctypes/_ctypes.c |
| diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Modules/_ctypes/_ctypes.c Wed Nov 13 13:23:35 2013 +0100 +++ b/Modules/_ctypes/_ctypes.c Wed Nov 13 13:24:50 2013 +0100 @@ -2344,7 +2344,11 @@ 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 *
