diff options
author | hobbs <hobbs> | 2004-02-17 04:56:00 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2004-02-17 04:56:00 (GMT) |
commit | 6a8f878ac9d38e985b0c75d96986ea6a2afbf375 (patch) | |
tree | 7a065b7971874a0933467f6fd116cd6b6644b0f3 /generic | |
parent | 6cde6afa8eab307813b0e6847bf7e3b7af5e81a6 (diff) | |
download | tcl-6a8f878ac9d38e985b0c75d96986ea6a2afbf375.zip tcl-6a8f878ac9d38e985b0c75d96986ea6a2afbf375.tar.gz tcl-6a8f878ac9d38e985b0c75d96986ea6a2afbf375.tar.bz2 |
* generic/tclTrace.c (TclTraceExecutionObjCmd)
(TclTraceCommandObjCmd): fix possible mem leak in trace info.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclTrace.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 021cb18..dd2422a 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTrace.c,v 1.7 2003/12/24 04:18:20 davygrvy Exp $ + * RCS: @(#) $Id: tclTrace.c,v 1.8 2004/02/17 04:56:01 hobbs Exp $ */ #include "tclInt.h" @@ -604,8 +604,6 @@ TclTraceExecutionObjCmd(interp, optionIndex, objc, objv) TraceCommandInfo *tcmdPtr = (TraceCommandInfo *) clientData; - eachTraceObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - /* * Build a list with the ops list as the first obj * element and the tcmdPtr->command string as the @@ -636,6 +634,7 @@ TclTraceExecutionObjCmd(interp, optionIndex, objc, objv) Tcl_DecrRefCount(elemObjPtr); continue; } + eachTraceObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr); Tcl_DecrRefCount(elemObjPtr); elemObjPtr = NULL; @@ -807,8 +806,6 @@ TclTraceCommandObjCmd(interp, optionIndex, objc, objv) TraceCommandInfo *tcmdPtr = (TraceCommandInfo *) clientData; - eachTraceObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - /* * Build a list with the ops list as * the first obj element and the tcmdPtr->command string @@ -831,6 +828,7 @@ TclTraceCommandObjCmd(interp, optionIndex, objc, objv) Tcl_DecrRefCount(elemObjPtr); continue; } + eachTraceObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr); Tcl_DecrRefCount(elemObjPtr); @@ -988,7 +986,6 @@ TclTraceVariableObjCmd(interp, optionIndex, objc, objv) TraceVarInfo *tvarPtr = (TraceVarInfo *) clientData; - eachTraceObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); /* * Build a list with the ops list as * the first obj element and the tcmdPtr->command string @@ -1013,6 +1010,7 @@ TclTraceVariableObjCmd(interp, optionIndex, objc, objv) Tcl_ListObjAppendElement(NULL, elemObjPtr, Tcl_NewStringObj("unset", 5)); } + eachTraceObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr); elemObjPtr = Tcl_NewStringObj(tvarPtr->command, -1); |