summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-03-16 20:02:36 (GMT)
committerThomas Heller <theller@ctypes.org>2006-03-16 20:02:36 (GMT)
commit0c6b0e9d05e516a2a02b14e2f807b9ddfbc5beb4 (patch)
treee8ac0ec94d4206137428d6cf4b93583f525f80f7 /Modules
parentaa47570bdf0e584f1e358152e91808c3d2c8623c (diff)
downloadcpython-0c6b0e9d05e516a2a02b14e2f807b9ddfbc5beb4.zip
cpython-0c6b0e9d05e516a2a02b14e2f807b9ddfbc5beb4.tar.gz
cpython-0c6b0e9d05e516a2a02b14e2f807b9ddfbc5beb4.tar.bz2
Fix a leak that would happen under error conditions (found by Coverty).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/cfield.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 336f265..2816a6a 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -1317,6 +1317,7 @@ Z_set(void *ptr, PyObject *value, unsigned size)
if (-1 == PyUnicode_AsWideChar((PyUnicodeObject *)value,
buffer, PyUnicode_GET_SIZE(value))) {
Py_DECREF(value);
+ Py_DECREF(keep);
return NULL;
}
Py_DECREF(value);