diff options
author | Kevin B Kenny <kennykb@acm.org> | 2011-08-06 20:49:35 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2011-08-06 20:49:35 (GMT) |
commit | d90ed9c0f07bbb5cf66140e89fcebc0da3f08285 (patch) | |
tree | 89f6af4a8ab2acf605c86fda7701bc847a0bc71f /generic/tclAssembly.c | |
parent | 45f4a7ec08a29687ec671b5ff71549f7dc1d659f (diff) | |
download | tcl-d90ed9c0f07bbb5cf66140e89fcebc0da3f08285.zip tcl-d90ed9c0f07bbb5cf66140e89fcebc0da3f08285.tar.gz tcl-d90ed9c0f07bbb5cf66140e89fcebc0da3f08285.tar.bz2 |
* generic/tclAssemnbly.c: Plug another memory leak. [Bug 3384840]
* generic/tclStrToD.c: Plug another memory leak. [Bug 3386975]
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r-- | generic/tclAssembly.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 22bcdcc..cd6dc38 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -859,15 +859,44 @@ CompileAssembleObj( /* * Assembly failed. Clean up and report the error. */ + + /* + * Free any literals that were constructed for the assembly. + */ for (i = 0; i < compEnv.literalArrayNext; i++) { TclReleaseLiteral(interp, compEnv.literalArrayPtr[i].objPtr); } + + /* + * Free any auxiliary data that was attached to the bytecode + * under construction. + */ + for (i = 0; i < compEnv.auxDataArrayNext; i++) { auxDataPtr = compEnv.auxDataArrayPtr + i; if (auxDataPtr->type->freeProc != NULL) { (auxDataPtr->type->freeProc)(auxDataPtr->clientData); } } + + /* + * TIP 280. If there is extended command line information, + * we need to clean it up. + */ + + if (compEnv.extCmdMapPtr != NULL) { + if (compEnv.extCmdMapPtr->type == TCL_LOCATION_SOURCE) { + Tcl_DecrRefCount(compEnv.extCmdMapPtr->path); + } + for (i = 0; i < compEnv.extCmdMapPtr->nuloc; ++i) { + ckfree(compEnv.extCmdMapPtr->loc[i].line); + } + if (compEnv.extCmdMapPtr->loc != NULL) { + ckfree(compEnv.extCmdMapPtr->loc); + } + Tcl_DeleteHashTable(&(compEnv.extCmdMapPtr->litInfo)); + } + TclFreeCompileEnv(&compEnv); return NULL; } |