Index: generic/nsf.c =================================================================== diff -u -r0ad07ea546a433973b6f8d91456b1e6ce0052fa9 -r4563271bbe9742d74ba021fa8f23caa9274d1649 --- generic/nsf.c (.../nsf.c) (revision 0ad07ea546a433973b6f8d91456b1e6ce0052fa9) +++ generic/nsf.c (.../nsf.c) (revision 4563271bbe9742d74ba021fa8f23caa9274d1649) @@ -12657,7 +12657,7 @@ } if (ctxPtr->colonLocalVarCache != NULL) { /*fprintf(stderr, "free colonLocalVarCache %p\n", (void*)ctxPtr->colonLocalVarCache);*/ - FREE(Tcl_Var*, ctxPtr->colonLocalVarCache); + FREE(int*, ctxPtr->colonLocalVarCache); } if (ctxPtr->returnsObj != NULL) { DECR_REF_COUNT2("returnsObj", ctxPtr->returnsObj); @@ -14162,10 +14162,11 @@ if (actualSelf != lastSelf) { const char *path; - Tcl_Obj *pathObj; + Tcl_Obj *pathObj = NULL; if (withinEnsemble) { pathObj = NsfMethodNamePath(interp, framePtr0, methodName); + INCR_REF_COUNT(pathObj); path = ObjStr(pathObj); } else { path = methodName; @@ -14176,7 +14177,7 @@ ClassName(actualClass) : ObjectName(actualSelf), path, subMethodName); subMethodCmd = NULL; - if (withinEnsemble) { + if (pathObj != NULL) { DECR_REF_COUNT(pathObj); } } @@ -20310,6 +20311,7 @@ &endOfFilterChain, ¤tCmd) == TCL_OK && cmd != NULL) { Tcl_Obj *pathObj = NsfMethodNamePath(interp, framePtr, methodName); + INCR_REF_COUNT(pathObj); methodName = isEnsemble ? ObjStr(pathObj) : lookupMethodName; result = MethodHandleObj((class != NULL) ? (NsfObject *)class : object, (class == NULL), methodName);