summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixWm.c
diff options
context:
space:
mode:
authorericm <ericm>2000-03-27 18:02:59 (GMT)
committerericm <ericm>2000-03-27 18:02:59 (GMT)
commit1572ee84e8f99582332894571332dbc6d4f06855 (patch)
tree4286e7851cd6c4fe593cdc6be0726354b5760a8f /unix/tkUnixWm.c
parent16b9be5313ada51ee31c48018912217deb5f09c5 (diff)
downloadtk-1572ee84e8f99582332894571332dbc6d4f06855.zip
tk-1572ee84e8f99582332894571332dbc6d4f06855.tar.gz
tk-1572ee84e8f99582332894571332dbc6d4f06855.tar.bz2
* unix/tkUnixWm.c: Applied patch from [Bug: 4405]; fixes memory
leak in Unix wm command.
Diffstat (limited to 'unix/tkUnixWm.c')
-rw-r--r--unix/tkUnixWm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 7b68074..5eca42a 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixWm.c,v 1.7 2000/02/10 08:53:19 hobbs Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.8 2000/03/27 18:02:59 ericm Exp $
*/
#include "tkPort.h"
@@ -1228,6 +1228,9 @@ Tk_WmCmd(clientData, interp, argc, argv)
if (wmPtr2->wrapperPtr == NULL) {
CreateWrapper(wmPtr2);
}
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
+ }
wmPtr->hints.window_group = Tk_WindowId(wmPtr2->wrapperPtr);
wmPtr->hints.flags |= WindowGroupHint;
wmPtr->leaderName = ckalloc((unsigned) (strlen(argv[3])+1));
@@ -1354,6 +1357,9 @@ Tk_WmCmd(clientData, interp, argc, argv)
TCL_STATIC);
return TCL_OK;
} else {
+ if (wmPtr->iconName != NULL) {
+ ckfree((char *) wmPtr->iconName);
+ }
wmPtr->iconName = ckalloc((unsigned) (strlen(argv[3]) + 1));
strcpy(wmPtr->iconName, argv[3]);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
@@ -1847,6 +1853,9 @@ Tk_WmCmd(clientData, interp, argc, argv)
TCL_STATIC);
return TCL_OK;
} else {
+ if (wmPtr->title != NULL) {
+ ckfree((char *) wmPtr->title);
+ }
wmPtr->title = ckalloc((unsigned) (strlen(argv[3]) + 1));
strcpy(wmPtr->title, argv[3]);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
@@ -1903,6 +1912,9 @@ Tk_WmCmd(clientData, interp, argc, argv)
CreateWrapper(wmPtr2);
}
wmPtr->master = Tk_WindowId(wmPtr2->wrapperPtr);
+ if (wmPtr->masterWindowName != NULL) {
+ ckfree((char *) wmPtr->masterWindowName);
+ }
wmPtr->masterWindowName = ckalloc((unsigned) (strlen(argv[3])+1));
strcpy(wmPtr->masterWindowName, argv[3]);
}