This very sense has been related from Amir al-mu'minin, Imam Ali (as), peace be upon him, in a different version
as follows:
The heart of a fool is in his mouth
while the tongue of the wise man is in his heart.
The meaning of both the sayings (40 and 41) is the same.