summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-18 17:35:55 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-18 17:35:55 (GMT)
commit2399ad51d435495636106ce2695712499983a715 (patch)
treeaef5c4019580ff18b9aa89b39553b22208849a66
parented4a1c57034d53bf217d64a771208d372ad9e1a5 (diff)
downloadcpython-2399ad51d435495636106ce2695712499983a715.zip
cpython-2399ad51d435495636106ce2695712499983a715.tar.gz
cpython-2399ad51d435495636106ce2695712499983a715.tar.bz2
Issue #19437: Fix error handling of CDataType_from_buffer()
KeepRef() decreases the reference counter of its 'keep' parameter on error
-rw-r--r--Modules/_ctypes/_ctypes.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index f47dbdf..be0f33a 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -454,7 +454,6 @@ CDataType_from_buffer(PyObject *type, PyObject *args)
Py_INCREF(obj);
if (-1 == KeepRef((CDataObject *)result, -1, obj)) {
- Py_DECREF(result);
return NULL;
}
return result;