1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #307, fix some memory leaking

This commit is contained in:
winlin 2020-04-07 19:07:11 +08:00
parent e22d1dffc1
commit a8cc3a3430
3 changed files with 9 additions and 3 deletions

View file

@ -1339,9 +1339,11 @@ void SrsRtcServer::clear()
{
for (int i = 0; i < (int)mmhdrs.size(); i++) {
msghdr* hdr = &mmhdrs[i].msg_hdr;
for (int i = 0; i < (int)hdr->msg_iovlen; i++) {
iovec* iov = hdr->msg_iov + i;
delete (char*)iov->iov_base;
for (int j = (int)hdr->msg_iovlen - 1; j >= 0 ; j--) {
iovec* iov = hdr->msg_iov + j;
char* data = (char*)iov->iov_base;
srs_freep(data);
srs_freep(iov);
}
}