summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2011-08-06 20:49:35 (GMT)
committerKevin B Kenny <kennykb@acm.org>2011-08-06 20:49:35 (GMT)
commitd90ed9c0f07bbb5cf66140e89fcebc0da3f08285 (patch)
tree89f6af4a8ab2acf605c86fda7701bc847a0bc71f
parent45f4a7ec08a29687ec671b5ff71549f7dc1d659f (diff)
downloadtcl-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]
-rw-r--r--ChangeLog1
-rw-r--r--generic/tclAssembly.c29
-rwxr-xr-xgeneric/tclStrToD.c3
3 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 30568c7..293490a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2011-08-06 Kevin B, Kenny <kennykb@acm.org>
* generic/tclAssemnbly.c: Plug another memory leak. [Bug 3384840]
+ * generic/tclStrToD.c: Plug another memory leak. [Bug 3386975]
2011-08-05 Kevin B. Kenny <kennykb@acm.org>
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;
}
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index c2d4ed8..a55ee83 100755
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -4479,6 +4479,9 @@ TclFinalizeDoubleConversion(void)
for (i=0; i<9; ++i) {
mp_clear(pow5 + i);
}
+ for (i=0; i < 5; ++i) {
+ mp_clear(pow5_13 + i);
+ }
}
/*