Skip to content

Commit bcb5e35

Browse files
committed
Don't exit rtpp_polltbl_free() early if the allocated length
is 0. We still need to destroy few things here, might cause descriptor leak under librtpproxy.
1 parent 24a86fe commit bcb5e35

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/rtpp_sessinfo.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,19 +373,16 @@ rtpp_polltbl_free(struct rtpp_polltbl *ptbl)
373373
{
374374
int i;
375375

376-
if (ptbl->aloclen == 0) {
377-
return;
378-
}
379-
if (ptbl->curlen > 0) {
376+
if (ptbl->aloclen != 0) {
380377
for (i = 0; i < ptbl->curlen; i++) {
381378
int fd = CALL_SMETHOD(ptbl->mds[i].skt, getfd);
382379
rtpp_epoll_ctl(ptbl->epfd, EPOLL_CTL_DEL, fd, NULL);
383380
RTPP_OBJ_DECREF(ptbl->mds[i].skt);
384381
}
382+
free(ptbl->mds);
385383
}
386384
close(ptbl->wakefd[0]);
387385
close(ptbl->epfd);
388-
free(ptbl->mds);
389386
}
390387

391388
static int

0 commit comments

Comments
 (0)