Trap buffer allocation errors