diff options
author | rjohnson <rjohnson@noemail.net> | 1998-09-30 23:46:16 (GMT) |
---|---|---|
committer | rjohnson <rjohnson@noemail.net> | 1998-09-30 23:46:16 (GMT) |
commit | b353f2ccb988de788b8893d2a6008ef8da4b1e47 (patch) | |
tree | 05d6c9fef1b5d7ef8b9c2da627927b8dd70d8b91 /unix | |
parent | c9e137251f5043d61c83f523628c00f96f23f481 (diff) | |
download | tk-b353f2ccb988de788b8893d2a6008ef8da4b1e47.zip tk-b353f2ccb988de788b8893d2a6008ef8da4b1e47.tar.gz tk-b353f2ccb988de788b8893d2a6008ef8da4b1e47.tar.bz2 |
Fixed memory leak in unix wm command
FossilOrigin-Name: 4ba720fca0f4ca695f6898a8a90edc74b6f3dbd0
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tkUnixWm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index ccce80e..1caf65d 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -8,11 +8,12 @@ * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. + * Copyright (c) 1998 by Scriptics Corporation. * * 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.2 1998/09/14 18:23:58 stanton Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.3 1998/09/30 23:46:17 rjohnson Exp $ */ #include "tkPort.h" @@ -1324,6 +1325,9 @@ Tk_WmCmd(clientData, interp, argc, argv) interp->result = (wmPtr->iconName != NULL) ? wmPtr->iconName : ""; return TCL_OK; } else { + if (wmPtr->iconName != NULL) { + ckfree(wmPtr->iconName); + } wmPtr->iconName = ckalloc((unsigned) (strlen(argv[3]) + 1)); strcpy(wmPtr->iconName, argv[3]); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { @@ -1723,6 +1727,9 @@ Tk_WmCmd(clientData, interp, argc, argv) : winPtr->nameUid; return TCL_OK; } else { + if (wmPtr->title != NULL) { + ckfree(wmPtr->title); + } wmPtr->title = ckalloc((unsigned) (strlen(argv[3]) + 1)); strcpy(wmPtr->title, argv[3]); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { |