summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-05-07 15:26:20 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-05-07 15:26:20 (GMT)
commitc9ca13a50c7725c87968a8ce5e2053d23b5bd5cf (patch)
tree46ab66a7399b0378dd0c4878d2955fe578f3206d
parent0141bbbd2f31ab6734963fd5e653f1a5a93b646d (diff)
downloadtcl-c9ca13a50c7725c87968a8ce5e2053d23b5bd5cf.zip
tcl-c9ca13a50c7725c87968a8ce5e2053d23b5bd5cf.tar.gz
tcl-c9ca13a50c7725c87968a8ce5e2053d23b5bd5cf.tar.bz2
Fixed memory leak caused by confusion about string ownership. [Bug 731706]
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclDictObj.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c7f9ec..f3885f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-07 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tclDictObj.c (DictInfoCmd): Fixed memory leak caused by
+ confusion about string ownership. [Bug 731706]
+
2003-05-05 Don Porter <dgp@users.sourceforge.net>
* generic/tclBasic.c: Implementation of TIP 90, which
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 3a03e2c..8a9ab53 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDictObj.c,v 1.9 2003/04/29 08:13:41 dkf Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.10 2003/05/07 15:26:27 dkf Exp $
*/
#include "tclInt.h"
@@ -1648,8 +1648,10 @@ DictInfoCmd(interp, objc, objv)
}
}
dict = (Dict *)dictPtr->internalRep.otherValuePtr;
- Tcl_SetObjResult(interp,
- Tcl_NewStringObj(Tcl_HashStats(&dict->table), -1));
+ /*
+ * This next cast is actually OK.
+ */
+ Tcl_SetResult(interp, (char *)Tcl_HashStats(&dict->table), TCL_DYNAMIC);
return TCL_OK;
}