Use proper C++ memory allocation and renamed message_t to messagePacket