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)
commitbc34ab780eb1ae322a8bad7b0cc71e9bf2774f06 (patch)
treea175336db107c0e7eea4370729c8c54f9f18e41a /generic/tclBasic.c
parent1e583a7fa75fad88194efc07175027933f119930 (diff)
downloadtcl-bc34ab780eb1ae322a8bad7b0cc71e9bf2774f06.zip
tcl-bc34ab780eb1ae322a8bad7b0cc71e9bf2774f06.tar.gz
tcl-bc34ab780eb1ae322a8bad7b0cc71e9bf2774f06.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);
}
}