diff options
author | dgp <dgp@noemail.net> | 2013-03-11 12:55:29 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2013-03-11 12:55:29 (GMT) |
commit | 5f4b0ef843c83fa8695f06d3ec0a414444604db7 (patch) | |
tree | c0d4f0ded6d161132b16a0b6ec9e31db28a0b8a9 /generic/tclLiteral.c | |
parent | 18d5e3cb9186bcbd142837b697e628c15a6cf096 (diff) | |
parent | 8f6bee9e242405bf8c5da1bb6303eac1d34343ca (diff) | |
download | tcl-5f4b0ef843c83fa8695f06d3ec0a414444604db7.zip tcl-5f4b0ef843c83fa8695f06d3ec0a414444604db7.tar.gz tcl-5f4b0ef843c83fa8695f06d3ec0a414444604db7.tar.bz2 |
3607246,3607372 Unbalanced refcounts of literals in the global literal table.
FossilOrigin-Name: c440d13b9752ad090f2c601782a74e12ae7d846a
Diffstat (limited to 'generic/tclLiteral.c')
-rw-r--r-- | generic/tclLiteral.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index ce258cf..11da6f8 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -1010,8 +1010,13 @@ TclInvalidateCmdLiteral( Tcl_Obj *literalObjPtr = TclCreateLiteral(iPtr, (char *) name, strlen(name), -1, NULL, nsPtr, 0, NULL); - if (literalObjPtr != NULL && literalObjPtr->typePtr == &tclCmdNameType) { - TclFreeIntRep(literalObjPtr); + if (literalObjPtr != NULL) { + if (literalObjPtr->typePtr == &tclCmdNameType) { + TclFreeIntRep(literalObjPtr); + } + /* Balance the refcount effects of TclCreateLiteral() above */ + Tcl_IncrRefCount(literalObjPtr); + TclReleaseLiteral(interp, literalObjPtr); } } |