It is reported that Imām Mālik said to one of his companions:

Do not leave your house a lot, except for something that you must do. And do not sit in a gathering in which you do not benefit some knowledge.

Al-Qāḍī ʿAyyāḍ, Tartīb Al-Madārik 2:63