From 2399ad51d435495636106ce2695712499983a715 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 18 Nov 2013 18:35:55 +0100 Subject: [PATCH] Issue #19437: Fix error handling of CDataType_from_buffer() KeepRef() decreases the reference counter of its 'keep' parameter on error --- Modules/_ctypes/_ctypes.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index f47dbdf1ff4..be0f33a69e9 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;