From 0c6b0e9d05e516a2a02b14e2f807b9ddfbc5beb4 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Thu, 16 Mar 2006 20:02:36 +0000 Subject: [PATCH] Fix a leak that would happen under error conditions (found by Coverty). --- Modules/_ctypes/cfield.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 336f26543f6..2816a6a2ab1 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);