Add assertion after malloc in the message class