[Python-checkins] r43087 - python/trunk/Modules/_ctypes/cfield.c

thomas.heller python-checkins at python.org
Thu Mar 16 21:02:39 CET 2006


Author: thomas.heller
Date: Thu Mar 16 21:02:36 2006
New Revision: 43087

Modified:
   python/trunk/Modules/_ctypes/cfield.c
Log:
Fix a leak that would happen under error conditions (found by Coverty).


Modified: python/trunk/Modules/_ctypes/cfield.c
==============================================================================
--- python/trunk/Modules/_ctypes/cfield.c	(original)
+++ python/trunk/Modules/_ctypes/cfield.c	Thu Mar 16 21:02:36 2006
@@ -1317,6 +1317,7 @@
 		if (-1 == PyUnicode_AsWideChar((PyUnicodeObject *)value,
 					       buffer, PyUnicode_GET_SIZE(value))) {
 			Py_DECREF(value);
+			Py_DECREF(keep);
 			return NULL;
 		}
 		Py_DECREF(value);


More information about the Python-checkins mailing list