summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2005-11-04 22:38:38 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2005-11-04 22:38:38 (GMT)
commita371489bc6ceddc40588b7fc34595e01989d633d (patch)
treeadcafce2861cb0011abba51ff7721b2c425f5bad /generic/tclCmdMZ.c
parent137f3babeb8df0e8ffaba858265c4472b80adb29 (diff)
downloadtcl-a371489bc6ceddc40588b7fc34595e01989d633d.zip
tcl-a371489bc6ceddc40588b7fc34595e01989d633d.tar.gz
tcl-a371489bc6ceddc40588b7fc34595e01989d633d.tar.bz2
* generic/tclBinary.c:
* generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclIOCmd.c: * generic/tclLink.c: * generic/tclTest.c: * generic/tclVar.c: fix for [Bug 1334947]. The functions TclPtrSetVar, Tcl_ObjSetVar2 and Tcl_SetVar2Ex now always consume the newValuePtr argument - i.e., they will free a 0-refCount object if they failed to set the variable. Fixed all callers in the core.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index a016124..1472f43 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.132 2005/10/08 14:42:44 dgp Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.133 2005/11/04 22:38:38 msofer Exp $
*/
#include "tclInt.h"
@@ -367,7 +367,6 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv)
Tcl_Obj *valuePtr;
valuePtr = Tcl_ObjSetVar2(interp, objv[i], NULL, newPtr, 0);
if (valuePtr == NULL) {
- Tcl_DecrRefCount(newPtr);
Tcl_AppendResult(interp, "couldn't set variable \"",
TclGetString(objv[i]), "\"", (char *) NULL);
return TCL_ERROR;
@@ -2730,7 +2729,6 @@ Tcl_SwitchObjCmd(dummy, interp, objc, objv)
TclNewObj(emptyObj);
if (Tcl_ObjSetVar2(interp, indexVarObj, NULL, emptyObj,
TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_DecrRefCount(emptyObj);
return TCL_ERROR;
}
}
@@ -2740,9 +2738,6 @@ Tcl_SwitchObjCmd(dummy, interp, objc, objv)
}
if (Tcl_ObjSetVar2(interp, matchVarObj, NULL, emptyObj,
TCL_LEAVE_ERR_MSG) == NULL) {
- if (indexVarObj == NULL) {
- Tcl_DecrRefCount(emptyObj);
- }
return TCL_ERROR;
}
}
@@ -2829,8 +2824,6 @@ Tcl_SwitchObjCmd(dummy, interp, objc, objv)
if (indexVarObj != NULL) {
if (Tcl_ObjSetVar2(interp, indexVarObj, NULL, indicesObj,
TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_DecrRefCount(indicesObj);
-
/*
* Careful! Check to see if we have allocated the list of
* matched strings; if so (but there was an error assigning
@@ -2848,8 +2841,6 @@ Tcl_SwitchObjCmd(dummy, interp, objc, objv)
if (matchVarObj != NULL) {
if (Tcl_ObjSetVar2(interp, matchVarObj, NULL, matchesObj,
TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_DecrRefCount(matchesObj);
-
/*
* Unlike above, if indicesObj is non-NULL at this point, it
* will have been written to a variable already and will hence