Srimad Bhagvata Mahapurana: Book 6: Chapter 2: Verses 13-19
Therefore, do not take, by a wrong path (the path of the sinners), (the soul of) this man, who has done atonement for all (his) sins in that he articulated the Lord's name in full (while, as a matter of fact, it wipes out one's sins even when uttered in part) and at a time when he was about to die (when there was no possibility of his reverting to the path of sin and thereby incurring any more sin; for one cannot ordinarily be expected to take the Lord's name precisely at the moment of death). The learned recognize the articulation of a name of Lord Visnu as capable of eradicating all one's sins, even when it is intended to denote someone else, or when it is uttered jestingly (in love but not jeeringly) or as an interjection in the midst of a song or out of (seeming) disrespect (but not real; for disrespect actually shown to the Lord or a jeer flung at Him constitutes in itself an unpardonable sin). A man who articulates the word'Hari' (or, for that matter, any other name of the Lord even) involuntarily (without any conscious effort on his part) when fallen down, stumbled, bitten (by a snake or any other poisonous creature) heated (by fever etc.), injured (by a blow) or when he has broken a limb, no longer deserves (to suffer) torment (in hell). Arduous and easy processes of expiation have been thoughtfully prescribed by the great sages (law-givers) in the case of (comparatively) great and small sins. Those sins are (certainly) got rid of by the said processes of expiation such as austere penance, charity and Japa (muttering of prayers), but not the kernel (vestiges in the form of impressions) of those sins, which is (also) traceable to the unrighteous acts. Those impressions too are obliterated through the service of (devotion to) the Lord's feet.
Any name of the Lord of excellent renown, which is distinctly pronounced (by a man)-(whether) knowingly (with the consciousness that it wipes out all one's sins) or unknowingly (without such knowledge)-destroys a man's sins (as surely) as a fire consumes the fuel (under all circumstances, no matter whether it has been kindled by a man who knows its burning properties or by an innocent child who is unaware of its burning capacity). Just as a medicine possessing the highest potency is sure to produce its salutary effect even on one who is unaware of its efficacy, though taken by chance, so does the Lord's name (which is as holy as any sacred text or formula) reveal its efficacy (in the shape of wiping out all one's sins) even in the case of him who is unaware of it, when uttered by him (even) casually.