diff Objects/structseq.c @ 74943:08a85fc85bf2 2.7

Issue #13020: Fix a reference leak when allocating a structsequence object fails. Patch by Suman Saha.
author Antoine Pitrou <solipsis@pitrou.net>
date Wed, 15 Feb 2012 02:51:43 +0100
parents fd25030223b0
children d40e1e133039
line wrap: on
line diff
--- a/Objects/structseq.c	Wed Feb 15 02:42:46 2012 +0100
+++ b/Objects/structseq.c	Wed Feb 15 02:51:43 2012 +0100
@@ -201,6 +201,7 @@
 
     res = (PyStructSequence*) PyStructSequence_New(type);
     if (res == NULL) {
+        Py_DECREF(arg);
         return NULL;
     }
     for (i = 0; i < len; ++i) {