summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorstanton <stanton>1999-02-04 21:00:36 (GMT)
committerstanton <stanton>1999-02-04 21:00:36 (GMT)
commitbc0fcbc79eb5d50d8c902eeaaf15b0c2fb0f7541 (patch)
tree05c03be7e9772ed87d081bf4031165fe6ec3f06c /unix
parentdb7a3943c3777814d839ee0d6aa509ee82c00e4b (diff)
downloadtk-bc0fcbc79eb5d50d8c902eeaaf15b0c2fb0f7541.zip
tk-bc0fcbc79eb5d50d8c902eeaaf15b0c2fb0f7541.tar.gz
tk-bc0fcbc79eb5d50d8c902eeaaf15b0c2fb0f7541.tar.bz2
* unix/tkUnixSend.c (Tk_SetAppName): Fixed uninitialized memory
access bug. [Bug: 919]
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixSend.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 997fb81..79d5e7a 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixSend.c,v 1.2 1998/09/14 18:23:58 stanton Exp $
+ * RCS: @(#) $Id: tkUnixSend.c,v 1.3 1999/02/04 21:00:36 stanton Exp $
*/
#include "tkPort.h"
@@ -255,7 +255,7 @@ static int ValidateName _ANSI_ARGS_((TkDisplay *dispPtr,
* If "lock" is set then the server will be locked. It is the
* caller's responsibility to call RegClose when finished with
* the registry, so that we can write back the registry if
- * neeeded, unlock the server if needed, and free memory.
+ * needed, unlock the server if needed, and free memory.
*
*----------------------------------------------------------------------
*/
@@ -781,6 +781,7 @@ Tk_SetAppName(tkwin, name)
riPtr->interp = interp;
riPtr->dispPtr = winPtr->dispPtr;
riPtr->nextPtr = registry;
+ riPtr->name = NULL;
registry = riPtr;
Tcl_CreateCommand(interp, "send", Tk_SendCmd, (ClientData) riPtr,
DeleteProc);
@@ -795,8 +796,10 @@ Tk_SetAppName(tkwin, name)
* the name registry.
*/
- RegDeleteName(regPtr, riPtr->name);
- ckfree(riPtr->name);
+ if (riPtr->name) {
+ RegDeleteName(regPtr, riPtr->name);
+ ckfree(riPtr->name);
+ }
break;
}
}