Ignore:
Timestamp:
Jun 25, 2009 1:01:06 PM (15 years ago)
Author:
bennylp
Message:

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

  • backported changes from #786
File:
1 edited

Legend:

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

    r2802 r2811  
    449449    } 
    450450 
     451    /* Increment the dialog's lock otherwise when invite session creation 
     452     * fails the dialog will be destroyed prematurely. 
     453     */ 
     454    pjsip_dlg_inc_lock(dlg); 
     455 
    451456    /* Calculate call's secure level */ 
    452457    call->secure_level = get_secure_level(acc_id, dest_uri); 
     
    539544                     status); 
    540545 
    541         /* Upon failure to send first request, both dialog and invite  
     546        /* Upon failure to send first request, the invite  
    542547         * session would have been cleared. 
    543548         */ 
    544549        inv = NULL; 
    545         dlg = NULL; 
    546550        goto on_error; 
    547551    } 
     
    552556        *p_call_id = call_id; 
    553557 
     558    pjsip_dlg_dec_lock(dlg); 
    554559    pj_pool_release(tmp_pool); 
    555560    PJSUA_UNLOCK(); 
     
    559564 
    560565on_error: 
     566    if (dlg) { 
     567        /* This may destroy the dialog */ 
     568        pjsip_dlg_dec_lock(dlg); 
     569    } 
     570 
    561571    if (inv != NULL) { 
    562572        pjsip_inv_terminate(inv, PJSIP_SC_OK, PJ_FALSE); 
    563     } else if (dlg) { 
    564         pjsip_dlg_terminate(dlg); 
    565573    } 
    566574 
Note: See TracChangeset for help on using the changeset viewer.