Skip to content

Commit

Permalink
pjsua_handle_ip_change: Added missing null check for on_ip_changed_pr…
Browse files Browse the repository at this point in the history
…ogress callback (#3830)
  • Loading branch information
amubiera authored Jan 17, 2024
1 parent 98d51a0 commit 53d96cd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pjsip/src/pjsua-lib/pjsua_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3985,7 +3985,6 @@ PJ_DEF(pj_status_t) pjsua_handle_ip_change(const pjsua_ip_change_param *param)
/* Shutdown all TCP/TLS transports */
if (param->shutdown_transport) {
pjsip_tpmgr_shutdown_param param;
pjsua_ip_change_op_info info;

pjsip_tpmgr_shutdown_param_default(&param);
param.include_udp = PJ_FALSE;
Expand All @@ -3998,10 +3997,14 @@ PJ_DEF(pj_status_t) pjsua_handle_ip_change(const pjsua_ip_change_param *param)
/* Provide dummy info instead of NULL info to avoid possible crash
* (if app does not check).
*/
pj_bzero(&info, sizeof(info));
pjsua_var.ua_cfg.cb.on_ip_change_progress(
PJSUA_IP_CHANGE_OP_SHUTDOWN_TP,
status, &info);
if (pjsua_var.ua_cfg.cb.on_ip_change_progress) {
pjsua_ip_change_op_info info;

pj_bzero(&info, sizeof(info));
pjsua_var.ua_cfg.cb.on_ip_change_progress(
PJSUA_IP_CHANGE_OP_SHUTDOWN_TP,
status, &info);
}
}

if (param->restart_listener) {
Expand Down

0 comments on commit 53d96cd

Please sign in to comment.