diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | generic/tclBasic.c | 15 |
2 files changed, 15 insertions, 8 deletions
@@ -1,3 +1,11 @@ +2009-11-09 Andreas Kupries <andreask@activestate.com> + + * generic/tclBasic.c (TclEvalObjEx): Moved the #280 decrement of + refCount for the file path out of the branch after the whole + conditional, closing a memory leak. Added clause on structure type + to prevent seg.faulting. Forward port from valgrinding the Tcl 8.5 + branch. + 2009-11-08 Donal K. Fellows <dkf@users.sf.net> * doc/string.n (bytelength): Noted that this command is not a good diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 68fe439..be9ce4b 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.405 2009/10/31 20:18:43 dkf Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.406 2009/11/09 22:36:19 andreas_kupries Exp $ */ #include "tclInt.h" @@ -6099,14 +6099,13 @@ TclNREvalObjEx( result = TclEvalEx(interp, script, numSrcBytes, flags, ctxPtr->line[word], NULL, script); + } + if (pc && (ctxPtr->type == TCL_LOCATION_SOURCE)) { + /* + * Death of SrcInfo reference. + */ - if (pc) { - /* - * Death of SrcInfo reference. - */ - - Tcl_DecrRefCount(ctxPtr->data.eval.path); - } + Tcl_DecrRefCount(ctxPtr->data.eval.path); } TclStackFree(interp, ctxPtr); |