summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2004-05-04 03:52:28 (GMT)
committerandreas_kupries <akupries@shaw.ca>2004-05-04 03:52:28 (GMT)
commit0ee8afdd395f429b790f93da033ddb1f2dff5301 (patch)
treebdc55384c8888d511ec1c0e156d0abe224f5b3a0
parent28d5feccb98151b73cecc29767b67a375aebb261 (diff)
downloadtcl-0ee8afdd395f429b790f93da033ddb1f2dff5301.zip
tcl-0ee8afdd395f429b790f93da033ddb1f2dff5301.tar.gz
tcl-0ee8afdd395f429b790f93da033ddb1f2dff5301.tar.bz2
* Applied [SF Tcl Patch 868853], fixing a mem leak in
TtySetOptionProc. Report and Patch provided by Stuart Cassoff <stwo@users.sf.net>.
-rw-r--r--ChangeLog6
-rw-r--r--unix/tclUnixChan.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e05b1d0..5c25644 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-03 Andreas Kupries <andreask@activestate.com>
+
+ * Applied [SF Tcl Patch 868853], fixing a mem leak in
+ TtySetOptionProc. Report and Patch provided by Stuart
+ Cassoff <stwo@users.sf.net>.
+
2004-05-03 Miguel Sofer <msofer@users.sf.net>
* generic/tclProc.c (TclCreateProc): comments corrected.
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 138188d..484b649 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixChan.c,v 1.48 2004/04/06 22:25:56 dgp Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.49 2004/05/04 03:52:28 andreas_kupries Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -968,9 +968,11 @@ TtySetOptionProc(instanceData, interp, optionName, value)
"bad value for -xchar: should be a list of two elements",
(char *) NULL);
}
+ ckfree((char *) argv);
return TCL_ERROR;
}
SETIOSTATE(fsPtr->fd, &iostate);
+ ckfree((char *) argv);
return TCL_OK;
}
@@ -1003,12 +1005,14 @@ TtySetOptionProc(instanceData, interp, optionName, value)
"bad value for -ttycontrol: should be a list of",
"signal,value pairs", (char *) NULL);
}
+ ckfree((char *) argv);
return TCL_ERROR;
}
GETCONTROL(fsPtr->fd, &control);
while (argc > 1) {
if (Tcl_GetBoolean(interp, argv[1], &flag) == TCL_ERROR) {
+ ckfree((char *) argv);
return TCL_ERROR;
}
if (strncasecmp(argv[0], "DTR", strlen(argv[0])) == 0) {
@@ -1020,6 +1024,7 @@ TtySetOptionProc(instanceData, interp, optionName, value)
}
#else /* !TIOCM_DTR */
UNSUPPORTED_OPTION("-ttycontrol DTR");
+ ckfree((char *) argv);
return TCL_ERROR;
#endif /* TIOCM_DTR */
} else if (strncasecmp(argv[0], "RTS", strlen(argv[0])) == 0) {
@@ -1031,6 +1036,7 @@ TtySetOptionProc(instanceData, interp, optionName, value)
}
#else /* !TIOCM_RTS*/
UNSUPPORTED_OPTION("-ttycontrol RTS");
+ ckfree((char *) argv);
return TCL_ERROR;
#endif /* TIOCM_RTS*/
} else if (strncasecmp(argv[0], "BREAK", strlen(argv[0])) == 0) {
@@ -1038,6 +1044,7 @@ TtySetOptionProc(instanceData, interp, optionName, value)
SETBREAK(fsPtr->fd, flag);
#else /* !SETBREAK */
UNSUPPORTED_OPTION("-ttycontrol BREAK");
+ ckfree((char *) argv);
return TCL_ERROR;
#endif /* SETBREAK */
} else {
@@ -1046,12 +1053,14 @@ TtySetOptionProc(instanceData, interp, optionName, value)
"bad signal for -ttycontrol: must be ",
"DTR, RTS or BREAK", (char *) NULL);
}
+ ckfree((char *) argv);
return TCL_ERROR;
}
argc -= 2, argv += 2;
} /* while (argc > 1) */
SETCONTROL(fsPtr->fd, &control);
+ ckfree((char *) argv);
return TCL_OK;
}