Ignore:
Timestamp:
Dec 17, 2008 2:28:18 PM (16 years ago)
Author:
bennylp
Message:

Ticket 684: protect the memory allocation for TX packet with try/catch, and fixed various transmit data buffer leaks when transmission fails immediately

File:
1 edited

Legend:

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

    r2371 r2380  
    910910    } 
    911911 
    912     /* Create and attach pjsua_var data to the dialog: */ 
    913     call->inv = inv; 
    914  
    915     dlg->mod_data[pjsua_var.mod.id] = call; 
    916     inv->mod_data[pjsua_var.mod.id] = call; 
    917  
    918912    /* If account is locked to specific transport, then lock dialog 
    919913     * to this transport too. 
     
    926920    } 
    927921 
    928     /* Must answer with some response to initial INVITE. 
     922    /* Must answer with some response to initial INVITE. We'll do this before 
     923     * attaching the call to the invite session/dialog, so that the application 
     924     * will not get notification about this event (on another scenario, it is 
     925     * also possible that inv_send_msg() fails and causes the invite session to 
     926     * be disconnected. If we have the call attached at this time, this will 
     927     * cause the disconnection callback to be called before on_incoming_call() 
     928     * callback is called, which is not right). 
    929929     */ 
    930930    status = pjsip_inv_initial_answer(inv, rdata,  
     
    944944        if (status != PJ_SUCCESS) { 
    945945            pjsua_perror(THIS_FILE, "Unable to send 100 response", status); 
    946         } 
    947     } 
     946            PJSUA_UNLOCK(); 
     947            return PJ_TRUE; 
     948        } 
     949    } 
     950 
     951    /* Create and attach pjsua_var data to the dialog: */ 
     952    call->inv = inv; 
     953 
     954    dlg->mod_data[pjsua_var.mod.id] = call; 
     955    inv->mod_data[pjsua_var.mod.id] = call; 
    948956 
    949957    ++pjsua_var.call_cnt; 
     
    37263734                                            pjsip_event *e) 
    37273735{ 
    3728     pjsua_call *call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 
     3736    pjsua_call *call; 
    37293737 
    37303738    PJSUA_LOCK(); 
     3739 
     3740    call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 
     3741 
     3742    if (call == NULL) { 
     3743        PJSUA_UNLOCK(); 
     3744        return; 
     3745    } 
    37313746 
    37323747    /* Notify application callback first */ 
Note: See TracChangeset for help on using the changeset viewer.