mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-04 12:12:48 +00:00
res_pjsip_transport_websocket: Add NULL check in get_write_timeout
Added check for NULL return value when calling ast_sorcery_retrieve_by_id in function get_write_timeout ASTERISK-27046 Change-Id: I9357717278da631c3a1cb502c412693929b0cb41
This commit is contained in:
@@ -302,10 +302,14 @@ static int get_write_timeout(void)
|
||||
|
||||
for (; (transport_state = ao2_iterator_next(&it_transport_states)); ao2_cleanup(transport_state)) {
|
||||
struct ast_sip_transport *transport;
|
||||
|
||||
if (transport_state->type != AST_TRANSPORT_WS && transport_state->type != AST_TRANSPORT_WSS) {
|
||||
continue;
|
||||
}
|
||||
transport = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "transport", transport_state->id);
|
||||
if (!transport) {
|
||||
continue;
|
||||
}
|
||||
ast_debug(5, "Found %s transport with write timeout: %d\n",
|
||||
transport->type == AST_TRANSPORT_WS ? "WS" : "WSS",
|
||||
transport->write_timeout);
|
||||
|
Reference in New Issue
Block a user