Changeset 769


Ignore:
Timestamp:
Oct 13, 2006 5:45:38 PM (18 years ago)
Author:
bennylp
Message:

Fixed possible small memory leak in PJSUA registration

File:
1 edited

Legend:

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

    r737 r769  
    488488    pjsua_acc *acc; 
    489489    pj_str_t contact; 
     490    char contact_buf[512]; 
     491    pj_pool_t *pool; 
    490492    pj_status_t status; 
    491493 
     
    495497        PJ_LOG(3,(THIS_FILE, "Registrar URI is not specified")); 
    496498        return PJ_SUCCESS; 
     499    } 
     500 
     501    /* Destroy existing session, if any */ 
     502    if (acc->regc) { 
     503        pjsip_regc_destroy(acc->regc); 
     504        acc->regc = NULL; 
    497505    } 
    498506 
     
    508516    } 
    509517 
    510     status = pjsua_acc_create_uac_contact( pjsua_var.pool, &contact, 
     518    pool = pj_pool_create_on_buf(NULL, contact_buf, sizeof(contact_buf)); 
     519    status = pjsua_acc_create_uac_contact( pool, &contact, 
    511520                                           acc_id, &acc->cfg.reg_uri); 
    512521    if (status != PJ_SUCCESS) { 
     
    563572    if (renew) { 
    564573        if (pjsua_var.acc[acc_id].regc == NULL) { 
    565             // Need route set. 
    566574            status = pjsua_regc_init(acc_id); 
    567575            if (status != PJ_SUCCESS) { 
Note: See TracChangeset for help on using the changeset viewer.