app/system/uorb: fix error, memset() wrong size.

Signed-off-by: jihandong <jihandong@xiaomi.com>
This commit is contained in:
jihandong 2022-05-09 17:28:47 +08:00 committed by Alan Carvalho de Assis
parent 131e4dc69d
commit 74af9a8065

View File

@ -509,7 +509,7 @@ static void listener_monitor(FAR struct list_node *objlist, int nb_objects,
return;
}
recv_msgs = malloc(nb_objects * sizeof(int));
recv_msgs = calloc(nb_objects, sizeof(int));
if (!recv_msgs)
{
free(fds);
@ -560,8 +560,6 @@ static void listener_monitor(FAR struct list_node *objlist, int nb_objects,
return;
}
memset(recv_msgs, 0, sizeof(recv_msgs));
/* Loop poll and print recieved messages */
while ((!nb_msgs || nb_recv_msgs < nb_msgs) && !g_should_exit)