Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64151 - trunk/tools/build/v2/engine/src
From: ghost_at_[hidden]
Date: 2010-07-19 04:58:06


Author: vladimir_prus
Date: 2010-07-19 04:58:05 EDT (Mon, 19 Jul 2010)
New Revision: 64151
URL: http://svn.boost.org/trac/boost/changeset/64151

Log:
Fix memory leak.

Apparently, PyList_Append does not steal reference, after all.

Text files modified:
   trunk/tools/build/v2/engine/src/compile.c | 2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

Modified: trunk/tools/build/v2/engine/src/compile.c
==============================================================================
--- trunk/tools/build/v2/engine/src/compile.c (original)
+++ trunk/tools/build/v2/engine/src/compile.c 2010-07-19 04:58:05 EDT (Mon, 19 Jul 2010)
@@ -776,8 +776,8 @@
         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 );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk