diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-21 16:25:30 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-21 16:25:30 +0200 |
commit | 71945880fb2024a61eb6dc328c4094a293a7f802 (patch) | |
tree | f2465ba931facd5686695f457f20bac40f4ca29c | |
parent | 992fe2ab84cf9296cf04e128dedc16bcaaad8225 (diff) | |
parent | 8c4c1f6e669453165a31e03b131f089ae1271067 (diff) | |
download | cpython-git-71945880fb2024a61eb6dc328c4094a293a7f802.tar.gz |
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
@@ -159,6 +159,8 @@ Core and Builtins Library ------- +- Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj() + - Issue #9177: Calling read() or write() now raises ValueError, not AttributeError, on a closed SSL socket. Patch by Senko Rasic. diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 62a083b33d..6f40b1a1c5 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; |