Tcl_SetObjResult

void Tcl_SetObjResult(Tcl_Interp *interp, Tcl_Obj *objPtr)

Stores the Tcl_Obj value reference, objPtr, as the indicated interpreter's current result. It increases the reference count for objPtr and reduces the reference count on whatever was in there before (potentially causing the value to be disposed).

https://www.tcl-lang.org/man/tcl8.4/TclLib/SetResult.htm