Skip to content

Commit 37784ba

Browse files
committed
Issue python#13020: Fix a reference leak when allocating a structsequence object fails.
Patch by Suman Saha.
1 parent f5f1fe0 commit 37784ba

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.2.3?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #13020: Fix a reference leak when allocating a structsequence object
14+
fails. Patch by Suman Saha.
15+
1316
- Issue #13908: Ready types returned from PyType_FromSpec.
1417

1518
- Issue #11235: Fix OverflowError when trying to import a source file whose

Objects/structseq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
129129

130130
res = (PyStructSequence*) PyStructSequence_New(type);
131131
if (res == NULL) {
132+
Py_DECREF(arg);
132133
return NULL;
133134
}
134135
for (i = 0; i < len; ++i) {

0 commit comments

Comments
 (0)