Bug 1216815 - fix memory leaks in test TCP STUN server. r=mjf

This commit is contained in:
Nils Ohlmeier [:drno] 2015-10-20 17:07:09 -07:00
parent c6c2c2b643
commit c4d46806a2

View File

@ -608,6 +608,7 @@ void TestStunTcpServer::accept_cb(NR_SOCKET s, int how, void *cb_arg) {
if(nr_socket_buffered_stun_create(newsock, 2048, TURN_TCP_FRAMING, &bufsock)) {
MOZ_MTLOG(ML_ERROR, "Couldn't create connected tcp socket");
nr_socket_destroy(&newsock);
return;
}
@ -615,11 +616,13 @@ void TestStunTcpServer::accept_cb(NR_SOCKET s, int how, void *cb_arg) {
if(nr_socket_wrapped_create(bufsock, &wrapsock)) {
MOZ_MTLOG(ML_ERROR, "Couldn't wrap connected tcp socket");
nr_socket_destroy(&bufsock);
return;
}
if(nr_socket_getfd(bufsock, &fd)) {
if(nr_socket_getfd(wrapsock, &fd)) {
MOZ_MTLOG(ML_ERROR, "Couldn't get fd from connected tcp socket");
nr_socket_destroy(&wrapsock);
return;
}