summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-06-09 19:18:13 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-06-09 19:18:13 (GMT)
commitfbfdc190f5cf078f2ec07f759e6eaf162b889b5d (patch)
tree11d1099d9182e3d5219252fcaede194285caaf3c
parent3588e9bb50fc4405a0c6d00631c2317b95f45257 (diff)
downloadtk-fbfdc190f5cf078f2ec07f759e6eaf162b889b5d.zip
tk-fbfdc190f5cf078f2ec07f759e6eaf162b889b5d.tar.gz
tk-fbfdc190f5cf078f2ec07f759e6eaf162b889b5d.tar.bz2
ckfree() the correct element! [Bug 969358]
-rw-r--r--ChangeLog6
-rw-r--r--generic/tkUndo.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 00ce3db..8ad0f5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkUndo.c (TkUndoSetDepth): Delete the unlinked element and
+ not the next element. Stops a crash in some situations and a memory
+ leak in others. Thanks to Jiang Wu for spotting this. [Bug 969358]
+
2004-06-08 Mo DeJong <mdejong@users.sourceforge.net>
* generic/tkCanvText.c (DisplayCanvText): Fix text
diff --git a/generic/tkUndo.c b/generic/tkUndo.c
index 64143f1..a1f5284 100644
--- a/generic/tkUndo.c
+++ b/generic/tkUndo.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUndo.c,v 1.3 2003/10/30 23:35:14 dkf Exp $
+ * RCS: @(#) $Id: tkUndo.c,v 1.4 2004/06/09 19:18:14 dkf Exp $
*/
#include "tkUndo.h"
@@ -249,7 +249,7 @@ TkUndoSetDepth(stack, maxdepth)
while (elem != NULL) {
prevelem = elem;
elem = elem->next;
- ckfree((char *) elem);
+ ckfree((char *) prevelem);
}
stack->depth = stack->maxdepth;
}