Fix unmatched temporary buffer allocations