Ignore:
Timestamp:
Apr 14, 2009 11:10:31 AM (15 years ago)
Author:
bennylp
Message:

Ticket #786: Crash when UAC invite or subscribe session initialization fails (thanks Rostislav Molodyko for the report)

File:
1 edited

Legend:

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

    r2506 r2593  
    468468    } 
    469469 
     470    /* Increment the dialog's lock otherwise when invite session creation 
     471     * fails the dialog will be destroyed prematurely. 
     472     */ 
     473    pjsip_dlg_inc_lock(dlg); 
     474 
    470475    /* Calculate call's secure level */ 
    471476    call->secure_level = get_secure_level(acc_id, dest_uri); 
     
    558563                     status); 
    559564 
    560         /* Upon failure to send first request, both dialog and invite  
     565        /* Upon failure to send first request, the invite  
    561566         * session would have been cleared. 
    562567         */ 
    563568        inv = NULL; 
    564         dlg = NULL; 
    565569        goto on_error; 
    566570    } 
     
    571575        *p_call_id = call_id; 
    572576 
     577    pjsip_dlg_dec_lock(dlg); 
    573578    pj_pool_release(tmp_pool); 
    574579    PJSUA_UNLOCK(); 
     
    578583 
    579584on_error: 
     585    if (dlg) { 
     586        /* This may destroy the dialog */ 
     587        pjsip_dlg_dec_lock(dlg); 
     588    } 
     589 
    580590    if (inv != NULL) { 
    581591        pjsip_inv_terminate(inv, PJSIP_SC_OK, PJ_FALSE); 
    582     } else if (dlg) { 
    583         pjsip_dlg_terminate(dlg); 
    584592    } 
    585593 
Note: See TracChangeset for help on using the changeset viewer.