diff options
author | dkf <dkf@noemail.net> | 2009-01-06 14:30:19 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2009-01-06 14:30:19 (GMT) |
commit | 6991c588b929dc1b872d6ab0177c96661c1c4ec8 (patch) | |
tree | 9adf9b59d360b0a43649921ec3f5fc11ebb80679 /generic/tclOOInfo.c | |
parent | f07e5df042ea4c336d9a41f7e7b157a6cd5976c0 (diff) | |
download | tcl-6991c588b929dc1b872d6ab0177c96661c1c4ec8.zip tcl-6991c588b929dc1b872d6ab0177c96661c1c4ec8.tar.gz tcl-6991c588b929dc1b872d6ab0177c96661c1c4ec8.tar.bz2 |
Fix [Bug 2489836]
FossilOrigin-Name: ee4e4fe8d0558cf378810d5995bcaed843b4096f
Diffstat (limited to 'generic/tclOOInfo.c')
-rw-r--r-- | generic/tclOOInfo.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index 583907b..44c5399 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.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: tclOOInfo.c,v 1.10 2008/10/16 22:34:18 nijtmans Exp $ + * RCS: @(#) $Id: tclOOInfo.c,v 1.11 2009/01/06 14:30:19 dkf Exp $ */ #ifdef HAVE_CONFIG_H @@ -586,7 +586,9 @@ InfoObjectMethodsCmd( Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(names[i], -1)); } - ckfree((char *) names); + if (numNames > 0) { + ckfree((char *) names); + } } else if (oPtr->methodsPtr) { FOREACH_HASH(namePtr, mPtr, oPtr->methodsPtr) { if (mPtr->typePtr != NULL && (mPtr->flags & flag) == flag) { @@ -1104,7 +1106,9 @@ InfoClassMethodsCmd( Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(names[i], -1)); } - ckfree((char *) names); + if (numNames > 0) { + ckfree((char *) names); + } } else { FOREACH_HASH_DECLS; |