Index: generic/nsf.c =================================================================== diff -u -N -r8e7256166e6acd815879baed0d2a95ca0230deae -r63c904a4ea0a45b77f8a2b0a3245424487907479 --- generic/nsf.c (.../nsf.c) (revision 8e7256166e6acd815879baed0d2a95ca0230deae) +++ generic/nsf.c (.../nsf.c) (revision 63c904a4ea0a45b77f8a2b0a3245424487907479) @@ -23374,9 +23374,12 @@ #if defined(NSF_FORWARD_WITH_ONERROR) if (unlikely(result == TCL_ERROR && tcd->onerror != NULL)) { - fprintf(stderr, "==== DEBUG AppVeyor: calling NsfForwardPrintError with error <<%s>>\n", ObjStr(Tcl_GetObjResult(interp))); - result = NsfForwardPrintError(interp, tcd, objc, objv, "%s", - ObjStr(Tcl_GetObjResult(interp))); + Tcl_Obj *resultObj = Tcl_GetObjResult(interp); + + INCR_REF_COUNT(resultObj); + // fprintf(stderr, "==== DEBUG AppVeyor: calling NsfForwardPrintError with error <<%s>>\n", ObjStr(resultObj)); + result = NsfForwardPrintError(interp, tcd, objc, objv, "%s", ObjStr(resultObj)); + DECR_REF_COUNT(resultObj); } #endif