Index: generic/nsf.c =================================================================== diff -u -r3b6da5512709d653d343274219876b49690719d1 -r8a650e1dbfbed57c711f07b8c8c151f6a9f70088 --- generic/nsf.c (.../nsf.c) (revision 3b6da5512709d653d343274219876b49690719d1) +++ generic/nsf.c (.../nsf.c) (revision 8a650e1dbfbed57c711f07b8c8c151f6a9f70088) @@ -4382,8 +4382,9 @@ * Compute the full method name for error messages containing the * ensemble root. * - * Results: - * Tcl_Obj, caller has to take care for ref-counting + * Results: + * Tcl_Obj of reference count 0, caller has to take care for + * refcounting * * Side effects: * None. @@ -4396,14 +4397,15 @@ Tcl_CallFrame *framePtr, const char *methodName) { - Tcl_Obj *resultObj = Tcl_NewListObj(0, NULL); - + Tcl_Obj *resultObj; + nonnull_assert(interp != NULL); nonnull_assert(methodName != NULL); - + if (framePtr != NULL) { - Tcl_ListObjAppendList(interp, resultObj, - CallStackMethodPath(interp, framePtr)); + resultObj = CallStackMethodPath(interp, framePtr); + } else { + resultObj = Tcl_NewListObj(0, NULL); } Tcl_ListObjAppendElement(interp, resultObj,