removed unnecessary null check (#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
This commit is contained in:
redraincatching 2025-06-20 17:51:52 +01:00 committed by GitHub
parent 62d91b0bc5
commit cb74638149
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -1131,9 +1131,7 @@ int create_relay_ioa_sockets(ioa_engine_handle e, ioa_socket_handle client_s, in
if (!rtcp_map_put(e->map_rtcp, *out_reservation_token, *rtcp_s)) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "%s: cannot update RTCP map\n", __FUNCTION__);
IOA_CLOSE_SOCKET(*rtp_s);
if (rtcp_s) {
IOA_CLOSE_SOCKET(*rtcp_s);
}
IOA_CLOSE_SOCKET(*rtcp_s);
return -1;
}
}

View File

@ -61,7 +61,7 @@ rtcp_map *rtcp_map_create(ioa_engine_handle e);
* true - success
* false - error
*/
bool rtcp_map_put(rtcp_map *map, rtcp_token_type key, ioa_socket_handle s);
bool rtcp_map_put(rtcp_map *map, rtcp_token_type token, ioa_socket_handle s);
/**
* @ret: