From: Thomas Heller Date: Thu, 16 Mar 2006 20:02:36 +0000 (+0000) Subject: Fix a leak that would happen under error conditions (found by Coverty). X-Git-Tag: v2.5a0~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c6b0e9d05e516a2a02b14e2f807b9ddfbc5beb4;p=python Fix a leak that would happen under error conditions (found by Coverty). --- diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 336f26543f..2816a6a2ab 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);