Changeset 6160


Ignore:
Timestamp:
Feb 7, 2020 8:20:56 AM (5 years ago)
Author:
ming
Message:

Re #2264: Fixed crash if pjsua_var.acc[acc_id].regc is NULL
Note that the regc instance itself hasn't been destroyed since the refcount has been incremented, but acc->regc can already be NULL-ed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r6142 r6160  
    27622762 
    27632763    if (status == PJ_SUCCESS) { 
     2764        pjsip_regc *regc = pjsua_var.acc[acc_id].regc; 
     2765 
    27642766        if (pjsua_var.acc[acc_id].cfg.allow_via_rewrite && 
    27652767            pjsua_var.acc[acc_id].via_addr.host.slen > 0) 
     
    27822784         * deadlock while making sure that regc won't be destroyed. 
    27832785         */ 
    2784         pjsip_regc_add_ref(pjsua_var.acc[acc_id].regc); 
     2786        pjsip_regc_add_ref(regc); 
    27852787        PJSUA_UNLOCK(); 
    27862788         
    27872789        //pjsua_process_msg_data(tdata, NULL); 
    2788         status = pjsip_regc_send( pjsua_var.acc[acc_id].regc, tdata ); 
     2790        status = pjsip_regc_send( regc, tdata ); 
    27892791         
    27902792        PJSUA_LOCK(); 
    2791         if (pjsip_regc_dec_ref(pjsua_var.acc[acc_id].regc) == PJ_EGONE) { 
     2793        if (pjsip_regc_dec_ref(regc) == PJ_EGONE) { 
    27922794            /* regc has been deleted. */ 
    27932795            goto on_return; 
Note: See TracChangeset for help on using the changeset viewer.