summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-02-15 01:51:43 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-02-15 01:51:43 (GMT)
commit37784ba5c08aed9a3153eb5a37014e59ee3769fe (patch)
tree1f7126686104362766ce69b0261d2603448fd34c /Objects/structseq.c
parentf5f1fe0cb5dedf37098622de318656003dc5230d (diff)
downloadcpython-37784ba5c08aed9a3153eb5a37014e59ee3769fe.zip
cpython-37784ba5c08aed9a3153eb5a37014e59ee3769fe.tar.gz
cpython-37784ba5c08aed9a3153eb5a37014e59ee3769fe.tar.bz2
Issue #13020: Fix a reference leak when allocating a structsequence object fails.
Patch by Suman Saha.
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index ef17f49..ac4f980 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -129,6 +129,7 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
res = (PyStructSequence*) PyStructSequence_New(type);
if (res == NULL) {
+ Py_DECREF(arg);
return NULL;
}
for (i = 0; i < len; ++i) {