fix: Eliminate memory leak in toxav.

This happens when shutting down a toxav session when it still has some
packets in its internal queue. It's not a serious leak and happens very
rarely (1 in 300 runs of the toxav_many_test), but it can happen and
long-running tox instances that start and end calls a lot would
eventually discover this.
This commit is contained in:
iphydf 2022-03-15 17:17:40 +00:00
parent caac17699e
commit 28623dcfa9
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -710,6 +710,9 @@ void rtp_kill(RTPSession *session)
LOGGER_DEBUG(session->m->log, "Terminated RTP session V3 work_buffer_list->next_free_entry: %d", LOGGER_DEBUG(session->m->log, "Terminated RTP session V3 work_buffer_list->next_free_entry: %d",
(int)session->work_buffer_list->next_free_entry); (int)session->work_buffer_list->next_free_entry);
for (int8_t i = 0; i < session->work_buffer_list->next_free_entry; ++i) {
free(session->work_buffer_list->work_buffer[i].buf);
}
free(session->work_buffer_list); free(session->work_buffer_list);
free(session); free(session);
} }