Changeset 3768 for pjproject


Ignore:
Timestamp:
Sep 22, 2011 6:13:22 AM (13 years ago)
Author:
bennylp
Message:

Fixed #1376: Crash if pjsua_call_get_info() is called with disconnected call

File:
1 edited

Legend:

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

    r3751 r3768  
    12421242{ 
    12431243    pjsua_call *call; 
    1244     pjsua_conf_port_id port_id; 
     1244    pjsua_conf_port_id port_id = PJSUA_INVALID_ID; 
    12451245 
    12461246    PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls,  
     
    12521252    PJSUA_LOCK(); 
    12531253 
     1254    if (!pjsua_call_is_active(call_id)) 
     1255        goto on_return; 
     1256 
    12541257    call = &pjsua_var.calls[call_id]; 
    12551258    port_id = call->conf_slot; 
    12561259 
     1260on_return: 
    12571261    PJSUA_UNLOCK(); 
    12581262 
     
    12791283     */ 
    12801284    PJSUA_LOCK(); 
     1285 
     1286    if (!pjsua_call_is_active(call_id)) { 
     1287        PJSUA_UNLOCK(); 
     1288        return PJSIP_ESESSIONTERMINATED; 
     1289    } 
    12811290 
    12821291    call = &pjsua_var.calls[call_id]; 
Note: See TracChangeset for help on using the changeset viewer.