Skip to content

Commit cb74638

Browse files
removed unnecessary null check (coturn#1706)
removing an unnecessary null check as raised in [this code scan](https://github.com/redraincatching/coturn/security/code-scanning/179) the variable is confirmed to not be null in an outer loop guard also changed the name of the variable in `rtcp_map_put`'s function declaration to match that used in its function definition
1 parent 62d91b0 commit cb74638

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/apps/relay/ns_ioalib_engine_impl.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,9 +1131,7 @@ int create_relay_ioa_sockets(ioa_engine_handle e, ioa_socket_handle client_s, in
11311131
if (!rtcp_map_put(e->map_rtcp, *out_reservation_token, *rtcp_s)) {
11321132
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "%s: cannot update RTCP map\n", __FUNCTION__);
11331133
IOA_CLOSE_SOCKET(*rtp_s);
1134-
if (rtcp_s) {
1135-
IOA_CLOSE_SOCKET(*rtcp_s);
1136-
}
1134+
IOA_CLOSE_SOCKET(*rtcp_s);
11371135
return -1;
11381136
}
11391137
}

src/server/ns_turn_maps_rtcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ rtcp_map *rtcp_map_create(ioa_engine_handle e);
6161
* true - success
6262
* false - error
6363
*/
64-
bool rtcp_map_put(rtcp_map *map, rtcp_token_type key, ioa_socket_handle s);
64+
bool rtcp_map_put(rtcp_map *map, rtcp_token_type token, ioa_socket_handle s);
6565

6666
/**
6767
* @ret:

0 commit comments

Comments
 (0)