diff options
| author | Miguel Sofer <miguel.sofer@gmail.com> | 2005-10-23 22:01:27 (GMT) |
|---|---|---|
| committer | Miguel Sofer <miguel.sofer@gmail.com> | 2005-10-23 22:01:27 (GMT) |
| commit | 64be4c1e63ef85d515bb28afe134159d649353f6 (patch) | |
| tree | c2da79f4e5a542014dab31edea47e6bd46a22b4c /generic/tclTest.c | |
| parent | ab628d4d6d0cbf74b48df435b3d8a2675cc8a0ee (diff) | |
| download | tcl-64be4c1e63ef85d515bb28afe134159d649353f6.zip tcl-64be4c1e63ef85d515bb28afe134159d649353f6.tar.gz tcl-64be4c1e63ef85d515bb28afe134159d649353f6.tar.bz2 | |
* generic/tclBasic.c:
* generic/tclBinary.c:
* generic/tclCmdAH.c:
* generic/tclCmdIL.c:
* generic/tclCmdMZ.c:
* generic/tclExecute.c:
* generic/tclLink.c:
* generic/tclMain.c:
* generic/tclProc.c:
* generic/tclScan.c:
* generic/tclTest.c:
* generic/tclVar.c:
* mac/tclMacInit.c:
* unix/tclUnixInit.c:
* win/tclWinInit.c: Insure that the core never calls TclPtrSetVar,
Tcl_SetVar2Ex, Tcl_ObjSetVar2 or Tcl_SetObjErrorCode with a 0-ref
new value. It is not possible to handle error returns correctly in
that case [Bug 1334947], one has the choice of leaking the object
in some cases, or else risk crashing in some others.
Diffstat (limited to 'generic/tclTest.c')
| -rw-r--r-- | generic/tclTest.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index dbd2b8e..e02ba13 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.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: tclTest.c,v 1.62.2.9 2004/08/16 14:18:25 msofer Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.62.2.10 2005/10/23 22:01:30 msofer Exp $ */ #define TCL_TEST @@ -3437,9 +3437,10 @@ TestregexpObjCmd(dummy, interp, objc, objv) info.matches[ii].end - 1); } } + Tcl_IncrRefCount(newPtr); valuePtr = Tcl_ObjSetVar2(interp, varPtr, NULL, newPtr, 0); + Tcl_DecrRefCount(newPtr); if (valuePtr == NULL) { - Tcl_DecrRefCount(newPtr); Tcl_AppendResult(interp, "couldn't set variable \"", Tcl_GetString(varPtr), "\"", (char *) NULL); return TCL_ERROR; |
