From 41c9f880d8bf59e80b6ca5963c3e9e2b17386736 Mon Sep 17 00:00:00 2001 From: Alex Martelli Date: Tue, 22 Apr 2003 09:24:48 +0000 Subject: [PATCH] fixed a potential refcount bug (thanks Raymond!). --- Python/bltinmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 0eb835793a0..6c1a3d290ca 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1824,10 +1824,10 @@ builtin_sum(PyObject *self, PyObject *args) if (PyObject_TypeCheck(result, &PyBaseString_Type)) { PyErr_SetString(PyExc_TypeError, "can't sum strings [use ''.join(seq) instead]"); - Py_DECREF(result); Py_DECREF(iter); return NULL; } + Py_INCREF(result); } for(;;) {