[Python-checkins] cpython: Issue #19437: Fix error handling of CDataType_from_buffer()

victor.stinner python-checkins at python.org
Mon Nov 18 18:41:28 CET 2013


http://hg.python.org/cpython/rev/8f770cdb7a19
changeset:   87246:8f770cdb7a19
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Nov 18 18:35:55 2013 +0100
summary:
  Issue #19437: Fix error handling of CDataType_from_buffer()

KeepRef() decreases the reference counter of its 'keep' parameter on error

files:
  Modules/_ctypes/_ctypes.c |  1 -
  1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -454,7 +454,6 @@
 
     Py_INCREF(obj);
     if (-1 == KeepRef((CDataObject *)result, -1, obj)) {
-        Py_DECREF(result);
         return NULL;
     }
     return result;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list