Skip to content

Commit

Permalink
Set variable opt if it's NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
sauwming committed Sep 14, 2024
1 parent 514d1f7 commit d78709a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pjsip/src/pjsua-lib/pjsua_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,8 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Failed to apply call setting", status);
goto on_error;
} else if (!opt) {
opt = &call->opt;
}

/* Create sound port if none is instantiated, to check if sound device
Expand Down Expand Up @@ -959,7 +961,7 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
* to using a randomly generated Call-ID
*/

if (opt && opt->custom_call_id.slen > 0) {
if( opt->custom_call_id.slen > 0 ){
pj_strdup(dlg->pool, &dlg->call_id->id, &opt->custom_call_id);
PJ_LOG(4,(THIS_FILE, "Set user defined "
"Call-ID (%.*s)",
Expand Down

0 comments on commit d78709a

Please sign in to comment.