make malloc and coverage share more code