summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-08-20 14:29:13 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-08-20 14:29:13 (GMT)
commit448e644c7e3981261214ecddd21923534377a6f2 (patch)
tree038556cfb30d8e691ca7babc928ca8671c0d9b14 /generic/tclCmdIL.c
parent9e2afa863774403642eba857799a3b5eee58e623 (diff)
downloadtcl-448e644c7e3981261214ecddd21923534377a6f2.zip
tcl-448e644c7e3981261214ecddd21923534377a6f2.tar.gz
tcl-448e644c7e3981261214ecddd21923534377a6f2.tar.bz2
Backport of memory leak plug.
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index e485347..fed7975 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,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.137.2.7 2009/07/16 20:50:54 dgp Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.137.2.8 2009/08/20 14:29:14 dkf Exp $
*/
#include "tclInt.h"
@@ -3501,6 +3501,9 @@ Tcl_LsortObjCmd(
for (i = 1; i < objc-1; i++) {
if (Tcl_GetIndexFromObj(interp, objv[i], switches, "option", 0,
&index) != TCL_OK) {
+ if (sortInfo.indexc > 1) {
+ ckfree((char *) sortInfo.indexv);
+ }
return TCL_ERROR;
}
switch ((enum Lsort_Switches) index) {