framework/messaging : Fix passing freed pointer
recv_packet is freed after calling user callback.
for receiving again, we should allocate the memory for recv_packet.
@@ -209,6 +209,7 @@ void messaging_run_callback(int signo, siginfo_t *data)
return;
}
+ while (1) {
/* recv_packet is used for receiving message including header. */
recv_packet = (char *)MSG_ALLOC(attr.mq_msgsize);
if (recv_packet == NULL) {
@@ -217,7 +218,6 @@ void messaging_run_callback(int signo, siginfo_t *data)
return;
}
- while (1) {
size = mq_receive(recv_info->mqdes, (char *)recv_packet, attr.mq_msgsize, 0);
if (size < 0) {
msgdbg("[Messaging] recv fail : mq_receive, errno %d\n", errno);
