Joe Conway <mail(at)joeconway(dot)com> writes:
> As you said, if the next ExecStoreTuple will try to do an
> ExecClearTuple(), ISTM that it should be removed from
> per_MultiFuncCall()/SRF_PERCALL_SETUP().
No, it's not necessary: ExecClearTuple knows the difference between a
full and an empty TupleSlot.
I'm not sure where the excess free is coming from, but it ain't
ExecClearTuple's fault. You might try setting a breakpoint at
heap_freetuple to see if that helps.
regards, tom lane