safer allocation of temporary storage