diff options
author | dkf <dkf@noemail.net> | 2000-11-23 15:53:25 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2000-11-23 15:53:25 (GMT) |
commit | f625696e0569fcd3623ac4b9bbed660c704eab78 (patch) | |
tree | 8a1db81f6243139a517612e76c465df90a065cfa | |
parent | c1127229bfc7e917698205a8b0dbd63e3adf08ad (diff) | |
download | tcl-f625696e0569fcd3623ac4b9bbed660c704eab78.zip tcl-f625696e0569fcd3623ac4b9bbed660c704eab78.tar.gz tcl-f625696e0569fcd3623ac4b9bbed660c704eab78.tar.bz2 |
Fixed memory leak from Bug #119398
FossilOrigin-Name: 738a6b889a61dd087c03e1c9cea064efe32da45c
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 7 |
2 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,8 @@ 2000-11-23 Donal K. Fellows <fellowsd@cs.man.ac.uk> + * generic/tclCmdIL.c (Tcl_LsortObjCmd): Fixed memory leak from Bug + #119398 + * library/init.tcl (unknown): Added specific level parameters to all uplevel invokations to boost performance; didn't dare touch the "namespace inscope" stuff though, since it looks sensitive diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 4cfb5af..7406451 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdIL.c,v 1.28 2000/09/17 22:40:41 ericm Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.29 2000/11/23 15:53:26 dkf Exp $ */ #include "tclInt.h" @@ -2796,12 +2796,9 @@ Tcl_LsortObjCmd(clientData, interp, objc, objv) sortInfo.resultCode = Tcl_ListObjGetElements(interp, objv[objc-1], &length, &listObjPtrs); - if (sortInfo.resultCode != TCL_OK) { + if (sortInfo.resultCode != TCL_OK || length <= 0) { goto done; } - if (length <= 0) { - return TCL_OK; - } elementArray = (SortElement *) ckalloc(length * sizeof(SortElement)); for (i=0; i < length; i++){ elementArray[i].objPtr = listObjPtrs[i]; |