summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--generic/tkWindow.c3
-rw-r--r--tests/main.test26
3 files changed, 29 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 168358c..b91409b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2008-04-07 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv
+ * tests/main.test (main-3.*): error. [Bug 1937135]
+
* generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (kenny)
2008-04-03 Pat Thoyts <patthoyts@users.sourceforge.net>
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 326f812..406eb7a 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.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: tkWindow.c,v 1.89.2.1 2008/04/02 04:05:13 dgp Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.89.2.2 2008/04/07 23:14:07 hobbs Exp $
*/
#include "tkInt.h"
@@ -3080,7 +3080,6 @@ Initialize(
if (Tk_ParseArgv(interp, (Tk_Window) NULL, &argc, argv,
argTable, TK_ARGV_DONT_SKIP_FIRST_ARG|TK_ARGV_NO_DEFAULTS)
!= TCL_OK) {
- ckfree((char *) argv);
goto argError;
}
p = Tcl_Merge(argc, argv);
diff --git a/tests/main.test b/tests/main.test
index d37240f..9a02438 100644
--- a/tests/main.test
+++ b/tests/main.test
@@ -8,7 +8,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: main.test,v 1.10 2004/12/08 03:03:06 dgp Exp $
+# RCS: @(#) $Id: main.test,v 1.10.4.1 2008/04/07 23:14:07 hobbs Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -99,6 +99,30 @@ test main-2.3 {Tk_MainEx: -encoding option} -constraints {
removeFile script
} -result {0 {-enc utf-8 script}}
+test main-3.1 {Tk_ParseArgv: -help option} -constraints unix -body {
+ # Run only on unix as Win32 pops up native dialog
+ list [catch {exec [interpreter] -help} msg] $msg
+} -match glob -result {1 {% Application initialization failed: Command-specific options:*}}
+
+test main-3.2 {Tk_ParseArgv: -help option} -setup {
+ set maininterp [interp create]
+} -body {
+ $maininterp eval { set argc 1 ; set argv -help }
+ list [catch {load {} Tk $maininterp} msg] $msg
+} -cleanup {
+ interp delete $maininterp
+} -match glob -result {1 {Command-specific options:*}}
+
+test main-3.3 {Tk_ParseArgv: -help option} -setup {
+ set maininterp [interp create]
+} -body {
+ # Repeat of 3.2 to catch cleanup, eg Bug 1927135
+ $maininterp eval { set argc 1 ; set argv -help }
+ list [catch {load {} Tk $maininterp} msg] $msg
+} -cleanup {
+ interp delete $maininterp
+} -match glob -result {1 {Command-specific options:*}}
+
# cleanup
cleanupTests
return