diff options
author | Thomas Heller <theller@ctypes.org> | 2006-08-15 13:07:21 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2006-08-15 13:07:21 (GMT) |
commit | 4dc5dd1f3b28bde2527b30d24052f00271d934ee (patch) | |
tree | dd19ae3fb83eb70a2fa1ddec907506c7e415751d /Modules | |
parent | 271a8689e98bc725ca9207dee52443d61f99211f (diff) | |
download | cpython-4dc5dd1f3b28bde2527b30d24052f00271d934ee.zip cpython-4dc5dd1f3b28bde2527b30d24052f00271d934ee.tar.gz cpython-4dc5dd1f3b28bde2527b30d24052f00271d934ee.tar.bz2 |
Check for NULL return value from new_CArgObject calls.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index db13910..3940de3 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1282,6 +1282,8 @@ c_void_p_from_param(PyObject *type, PyObject *value) struct fielddesc *fd = getentry("z"); parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'z'; parg->obj = fd->setfunc(&parg->value, value, 0); @@ -1297,6 +1299,8 @@ c_void_p_from_param(PyObject *type, PyObject *value) struct fielddesc *fd = getentry("Z"); parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'Z'; parg->obj = fd->setfunc(&parg->value, value, 0); @@ -1333,6 +1337,8 @@ c_void_p_from_param(PyObject *type, PyObject *value) CFuncPtrObject *func; func = (CFuncPtrObject *)value; parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'P'; Py_INCREF(value); |