Commits

Anonymous committed 08a85fc

Issue #13020: Fix a reference leak when allocating a structsequence object fails.
Patch by Suman Saha.

Comments (0)

Files changed (2)

 Core and Builtins
 -----------------
 
+- Issue #13020: Fix a reference leak when allocating a structsequence object
+  fails.  Patch by Suman Saha.
+
 - Issue #11235: Fix OverflowError when trying to import a source file whose
   modification time doesn't fit in a 32-bit timestamp.
 

Objects/structseq.c

 
     res = (PyStructSequence*) PyStructSequence_New(type);
     if (res == NULL) {
+        Py_DECREF(arg);
         return NULL;
     }
     for (i = 0; i < len; ++i) {