diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-21 14:24:51 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-21 14:24:51 (GMT) |
commit | 8c4c1f6e669453165a31e03b131f089ae1271067 (patch) | |
tree | 50ee3a85302c661abcfe32965a7e2523fe0a6428 | |
parent | 96f628f48797c0602e1421a42283740cc6ebfd67 (diff) | |
download | cpython-8c4c1f6e669453165a31e03b131f089ae1271067.zip cpython-8c4c1f6e669453165a31e03b131f089ae1271067.tar.gz cpython-8c4c1f6e669453165a31e03b131f089ae1271067.tar.bz2 |
Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -49,6 +49,8 @@ Core and Builtins Library ------- +- Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj() + - Issue #18513: Fix behaviour of cmath.rect w.r.t. signed zeros on OS X 10.8 + gcc. diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index c195694..a025a73 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -2671,8 +2671,8 @@ PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr) cmem->b_index = index; } else { /* copy contents of adr */ if (-1 == PyCData_MallocBuffer(cmem, dict)) { - return NULL; Py_DECREF(cmem); + return NULL; } memcpy(cmem->b_ptr, adr, dict->size); cmem->b_index = index; |