From e02ecc2e251654dcadfe40ebd5ce991b0951b655 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 19 Jul 2010 08:58:05 +0000 Subject: [PATCH] Fix memory leak. Apparently, PyList_Append does not steal reference, after all. [SVN r64151] --- v2/engine/src/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/engine/src/compile.c b/v2/engine/src/compile.c index 6cc6970fa..02f508bd6 100644 --- a/v2/engine/src/compile.c +++ b/v2/engine/src/compile.c @@ -776,8 +776,8 @@ call_python_function(RULE* r, FRAME* frame) for ( ; l; l = l->next ) { PyObject * v = PyString_FromString(l->string); - /* Steals reference to 'v' */ PyList_Append( arg, v ); + Py_DECREF(v); } /* Steals reference to 'arg' */ PyTuple_SetItem( arguments, i, arg );