summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2009-11-09 22:36:19 (GMT)
committerandreas_kupries <akupries@shaw.ca>2009-11-09 22:36:19 (GMT)
commit11dab762d5790cc735bd9b5239406d0b076f136f (patch)
treeb18d16468a8c5b2c27563f70d6b9137ec30adc98 /generic/tclBasic.c
parent0b59ce753401e295daaa781e76e9208a84e18548 (diff)
downloadtcl-11dab762d5790cc735bd9b5239406d0b076f136f.zip
tcl-11dab762d5790cc735bd9b5239406d0b076f136f.tar.gz
tcl-11dab762d5790cc735bd9b5239406d0b076f136f.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. Forward port from valgrinding the Tcl 8.5 branch.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c15
1 files changed, 7 insertions, 8 deletions
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);