summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2009-11-09 22:35:29 (GMT)
committerandreas_kupries <akupries@shaw.ca>2009-11-09 22:35:29 (GMT)
commitfac35a0f3e44f72d2c4d6248a4429e27b78bb2b7 (patch)
treea175336db107c0e7eea4370729c8c54f9f18e41a /generic/tclBasic.c
parent693fabcd0201d9f224ed7835ed1ffa7874253aac (diff)
downloadtcl-fac35a0f3e44f72d2c4d6248a4429e27b78bb2b7.zip
tcl-fac35a0f3e44f72d2c4d6248a4429e27b78bb2b7.tar.gz
tcl-fac35a0f3e44f72d2c4d6248a4429e27b78bb2b7.tar.bz2
* 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. Backport from valgrinding the Tcl 8.5 branch.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 1231dd7..0810f55 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -14,7 +14,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.75.2.38 2009/08/26 02:25:47 dgp Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.75.2.39 2009/11/09 22:35:30 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -5204,11 +5204,10 @@ TclEvalObjEx(interp, objPtr, flags, invoker, word)
result = EvalEx(interp, script, numSrcBytes, flags,
ctx.line [word], NULL, script);
-
- if (pc) {
- /* Death of SrcInfo reference */
- Tcl_DecrRefCount (ctx.data.eval.path);
- }
+ }
+ if (pc && (ctx.type == TCL_LOCATION_SOURCE)) {
+ /* Death of SrcInfo reference. */
+ Tcl_DecrRefCount(ctx.data.eval.path);
}
}