diff options
author | hobbs <hobbs> | 2005-10-10 21:20:58 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2005-10-10 21:20:58 (GMT) |
commit | 33189491c7086c538aa840c37a4c4f967926c7b2 (patch) | |
tree | 7f566011dc8173cd4467caaf9bf000fe0d07e9ab /generic | |
parent | 7e733ab325057aac1e7d23f4e6dda37e65bce9d2 (diff) | |
download | tk-33189491c7086c538aa840c37a4c4f967926c7b2.zip tk-33189491c7086c538aa840c37a4c4f967926c7b2.tar.gz tk-33189491c7086c538aa840c37a4c4f967926c7b2.tar.bz2 |
* generic/tkConfig.c (Tk_DeleteOptionTable, Tk_CreateOptionTable):
properly alloc/delete one more option. [Bug 1319720] (melbardis)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkConfig.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c index f74ae7a..87ad572 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConfig.c,v 1.20 2005/08/10 22:02:22 dkf Exp $ + * RCS: @(#) $Id: tkConfig.c,v 1.21 2005/10/10 21:21:00 hobbs Exp $ */ /* @@ -222,7 +222,7 @@ Tk_CreateOptionTable(interp, templatePtr) numOptions++; } tablePtr = (OptionTable *) (ckalloc(sizeof(OptionTable) - + ((numOptions - 1) * sizeof(Option)))); + + (numOptions * sizeof(Option)))); tablePtr->refCount = 1; tablePtr->hashEntryPtr = hashEntryPtr; tablePtr->nextPtr = NULL; @@ -347,7 +347,7 @@ Tk_DeleteOptionTable(optionTable) Tk_DeleteOptionTable((Tk_OptionTable) tablePtr->nextPtr); } - for (count = tablePtr->numOptions - 1, optionPtr = tablePtr->options; + for (count = tablePtr->numOptions, optionPtr = tablePtr->options; count > 0; count--, optionPtr++) { if (optionPtr->defaultPtr != NULL) { Tcl_DecrRefCount(optionPtr->defaultPtr); |