According to Islam one does not need to be infallible to be saved, but salvation requires gracefully outvirtuing your sinful eccentricity based on the concept of mezan in which ethical conduct plays major role.
قال الإمام الباقر(ع): اعلم بأنك لا تكون لنا وليا حتى لو اجتمع عليك أهل مصرك وقالوا:إنك رجل سوء لم يحزنك ذلك ولو قالوا : إنك رجل صالح لم يسرك
You have achieved sainthood when criticism does not hurt you and praise does not make you happy.