(original) (raw)
changeset: 74943:08a85fc85bf2 branch: 2.7 parent: 74938:7611fb3e19c6 user: Antoine Pitrou solipsis@pitrou.net date: Wed Feb 15 02:51:43 2012 +0100 files: Misc/NEWS Objects/structseq.c description: Issue #13020: Fix a reference leak when allocating a structsequence object fails. Patch by Suman Saha. diff -r 7611fb3e19c6 -r 08a85fc85bf2 Misc/NEWS --- a/Misc/NEWS Wed Feb 15 02:42:46 2012 +0100 +++ b/Misc/NEWS Wed Feb 15 02:51:43 2012 +0100 @@ -9,6 +9,9 @@ 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. diff -r 7611fb3e19c6 -r 08a85fc85bf2 Objects/structseq.c --- 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) { /solipsis@pitrou.net