diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-06-08 23:13:08 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-06-08 23:13:08 (GMT) |
commit | 903ca7048a4ab89a4962196a979014681d5db909 (patch) | |
tree | 09f75776cc9adc280d09fb5ab0e61e4c641380b2 | |
parent | 4819a5befc336eb974ac83e7b8cd60cb3b4b695b (diff) | |
download | tcl-903ca7048a4ab89a4962196a979014681d5db909.zip tcl-903ca7048a4ab89a4962196a979014681d5db909.tar.gz tcl-903ca7048a4ab89a4962196a979014681d5db909.tar.bz2 |
Plug leak. [Bug 1987817]
-rw-r--r-- | ChangeLog | 40 | ||||
-rw-r--r-- | generic/tclOOCall.c | 22 |
2 files changed, 40 insertions, 22 deletions
@@ -1,3 +1,8 @@ +2008-06-09 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclOOCall.c (TclOOGetSortedMethodList): Plug memory leak + that occurred when all methods were hidden. [Bug 1987817] + 2008-06-08 Miguel Sofer <msofer@users.sf.net> * generic/tclBasic.c: Compilation of uplevel scripts, allow * generic/tclCompCmds.c: non-body compiled scripts to access the @@ -6,41 +11,42 @@ * generic/tclExecute.c: compiler. This is [Patch 1973096] * generic/tclProc.c: * tests/uplevel.test: - 2008-06-06 Andreas Kupries <andreask@activestate.com> TIP #230 IMPLEMENTATION - * generic/tclIOCmd.c: Integration of transform commands into 'chan' ensemble. + * generic/tclIOCmd.c: Integration of transform commands into 'chan' + ensemble. * generic/tclInt.h: Definitions of the transform commands. * generic/tclIORTrans.c: Implementation of the reflection transforms. - * tests/chan.test: Tests updated for new sub-commands of 'chan'. + * tests/chan.test: Tests updated for new sub-commands of 'chan'. * tests/ioCmd.test: Tests updated for new sub-commands of 'chan'. - * tests/ioTrans.test: Whole new set of tests for the reflection transform. + * tests/ioTrans.test: Whole new set of tests for the reflection + transform. * unix/Makefile.in: Integration of new files into build rules. - * win/Makefile.in: Integration of new files into build rules. - * win/makefile.vc: Integration of new files into build rules. + * win/Makefile.in: Integration of new files into build rules. + * win/makefile.vc: Integration of new files into build rules. - NOTE: The file 'tclIORTrans.c' has a lot of code in common with - the file 'tclIORChan.c', as that made it much easier to - develop the reference implementation as a separate - module. Now that the transforms have been committed the one - thing left to do is to go over both modules and see which of - the common parts we can factor out and share. + NOTE: The file 'tclIORTrans.c' has a lot of code in common with the + file 'tclIORChan.c', as that made it much easier to develop the + reference implementation as a separate module. Now that the + transforms have been committed the one thing left to do is to go + over both modules and see which of the common parts we can + factor out and share. 2008-06-04 Pat Thoyts <patthoyts@users.sourceforge.net> * generic/tclBinary.c: TIP #317 implementation - * tests/binary.test: + * tests/binary.test: 2008-06-02 Kevin B. Kenny <kennykb@acm.org> * generic/tclOO.c (ReleaseClassContents): Fix the one remaining - valgrind complaint about oo.test, caused by failing to protect - the Object as well as the Class corresponding to a subclass being - deleted and hence getting a freed-memory read when attempting to - delete the class command. [Bug 1981001] + valgrind complaint about oo.test, caused by failing to protect the + Object as well as the Class corresponding to a subclass being deleted + and hence getting a freed-memory read when attempting to delete the + class command. [Bug 1981001] 2008-06-01 Donal K. Fellows <dkf@users.sf.net> diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 8a4024d..c5c9418 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.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: tclOOCall.c,v 1.5 2008/05/31 23:35:27 das Exp $ + * RCS: @(#) $Id: tclOOCall.c,v 1.6 2008/06/08 23:13:09 dkf Exp $ */ #ifdef HAVE_CONFIG_H @@ -431,8 +431,14 @@ TclOOGetSortedMethodList( * dealing with public method names. */ - qsort((void *) strings, (unsigned) i, sizeof(char *), CmpStr); - *stringsPtr = strings; + if (i > 0) { + if (i > 1) { + qsort((void *) strings, (unsigned) i, sizeof(char *), CmpStr); + } + *stringsPtr = strings; + } else { + ckfree((char *) strings); + } } Tcl_DeleteHashTable(&names); @@ -492,8 +498,14 @@ TclOOGetSortedClassMethodList( * dealing with public method names. */ - qsort((void *) strings, (unsigned) i, sizeof(char *), CmpStr); - *stringsPtr = strings; + if (i > 0) { + if (i > 1) { + qsort((void *) strings, (unsigned) i, sizeof(char *), CmpStr); + } + *stringsPtr = strings; + } else { + ckfree((char *) strings); + } } Tcl_DeleteHashTable(&names); |