api: fix call-time pass-by-reference error