Elements inserted into the `notifymsgs` queue by network_notifier() are
dequeued via SIMPLEQ_REMOVE_HEAD() in network_thread(). While their
message data was copied, the allocated memory for the dequeued element
was never freed.
Fix this by explicitly calling free() on the dequeued element after
copying its fields.
Reviewed-by: Dominique Martinet <
dominique...@atmark-techno.com>
Signed-off-by: Shota Shimoyama <
shota.s...@atmark-techno.com>
---
core/network_thread.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/core/network_thread.c b/core/network_thread.c
index 723bdea4..8678ae34 100644
--- a/core/network_thread.c
+++ b/core/network_thread.c
@@ -511,6 +511,7 @@ void *network_thread (void *data)
sizeof(msg.data.status.desc) - 1);
msg.data.status.current = notification->status;
msg.data.status.error = notification->error;
+ free(notification);
}
pthread_mutex_unlock(&msglock);
--
2.34.1