diff options
author | mig <mig@noemail.net> | 2011-08-04 18:40:05 (GMT) |
---|---|---|
committer | mig <mig@noemail.net> | 2011-08-04 18:40:05 (GMT) |
commit | 52f5d8ac663146901f02376f83c2b96fa3b6bc13 (patch) | |
tree | b2746d02acb430da74969ceb1bd3d4bd27f12fed /generic | |
parent | e1069f94a00106fe3d5e067507af1bc649150728 (diff) | |
download | tcl-52f5d8ac663146901f02376f83c2b96fa3b6bc13.zip tcl-52f5d8ac663146901f02376f83c2b96fa3b6bc13.tar.gz tcl-52f5d8ac663146901f02376f83c2b96fa3b6bc13.tar.bz2 |
* generic/tclVar.c (TclPtrSetVar): fix valgrind-detected error when newValuePtr is the interp's result obj.
FossilOrigin-Name: 8c944e4622758e32da6501e20a87f9165b138199
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclVar.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c index 55c031c..62bf1c4 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -1826,6 +1826,7 @@ TclPtrSetVar( Tcl_Obj *oldValuePtr; Tcl_Obj *resultPtr = NULL; int result; + int cleanupOnEarlyError = (newValuePtr->refCount == 0); /* * If the variable is in a hashtable and its hPtr field is NULL, then we @@ -1997,7 +1998,7 @@ TclPtrSetVar( return resultPtr; earlyError: - if (newValuePtr->refCount == 0) { + if (cleanupOnEarlyError) { Tcl_DecrRefCount(newValuePtr); } goto cleanup; |