summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2007-04-23 19:04:41 (GMT)
committerKevin B Kenny <kennykb@acm.org>2007-04-23 19:04:41 (GMT)
commit0346db3d28f76c5cd9878c41fe7401b3eddc9c68 (patch)
tree284942c1ba98ac7dff9d1317f1dbb89c9c143aea /generic/tclCompCmds.c
parent2db8334efef30d1215c4929bd3abc4e3e0598004 (diff)
downloadtcl-0346db3d28f76c5cd9878c41fe7401b3eddc9c68.zip
tcl-0346db3d28f76c5cd9878c41fe7401b3eddc9c68.tar.gz
tcl-0346db3d28f76c5cd9878c41fe7401b3eddc9c68.tar.bz2
* generic/tclCompCmds.c (TclCompileUpvarCmd): Plugged a memory
leak in 'upvar' when compiling (a) upvar outside a proc, (b) upvar with a syntax error, or (c) upvar where the frame index is not known at compile time. * generic/tclParseExpr.c (ParseExpr): Plugged a memory leak when parsing expressions that contain syntax errors.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 04f6bd5..8651432 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.108 2007/04/15 18:59:34 kennykb Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.109 2007/04/23 19:04:42 kennykb Exp $
*/
#include "tclInt.h"
@@ -5366,11 +5366,13 @@ TclCompileUpvarCmd(
Tcl_Obj *objPtr = Tcl_NewObj();
if (envPtr->procPtr == NULL) {
+ Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}
numWords = parsePtr->numWords;
if (numWords < 3) {
+ Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}
@@ -5409,6 +5411,7 @@ TclCompileUpvarCmd(
i = 3;
}
} else {
+ Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}