From 7d98fb9806907ae6849f57c66af9248952120cd9 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 17 Jun 2003 23:14:40 +0000 Subject: [PATCH] Add missing DECREF. --- Modules/itertoolsmodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index e2e820e6386..0a20c1b5682 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -1010,8 +1010,10 @@ chain_new(PyTypeObject *type, PyObject *args, PyObject *kwds) /* create chainobject structure */ lz = (chainobject *)type->tp_alloc(type, 0); - if (lz == NULL) + if (lz == NULL) { + Py_DECREF(ittuple); return NULL; + } lz->ittuple = ittuple; lz->iternum = 0;