As i understand it: 1. Create a new sv with refcount 1. 2. sv_2mortal() makes that refcount 0. 3. Put it on the stack, no refcount change. 4. call_sv(), stuff happens. there's a die(). 5. somewhere, either in the die() or after, perl will free everything on the orphaned stack, and your temps will be cleaned up.
Thank you for your explanation. It makes sense and I didn't think there would be a memory issue, but I wanted to make sure, because finding these types of bugs at a later stage might be difficult. Christian