Ignore:
Timestamp:
Jun 30, 2016 8:23:08 AM (8 years ago)
Author:
ming
Message:

Fixed #1929: Fixed memory leak when using sip_auth_client since it's also used by other components, such as sip_dialog, publishc, and pjsua_im.

Application should use the new API pjsip_auth_clt_deinit() to release the pool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c

    r5336 r5373  
    500500 
    501501 
     502/* Deinit client session. */ 
     503PJ_DEF(pj_status_t) pjsip_auth_clt_deinit(pjsip_auth_clt_sess *sess) 
     504{ 
     505    pjsip_cached_auth *auth; 
     506     
     507    PJ_ASSERT_RETURN(sess && sess->endpt, PJ_EINVAL); 
     508     
     509    auth = sess->cached_auth.next; 
     510    while (auth != &sess->cached_auth) { 
     511        pjsip_endpt_release_pool(sess->endpt, auth->pool); 
     512        auth = auth->next; 
     513    } 
     514 
     515    return PJ_SUCCESS; 
     516} 
     517 
     518 
    502519/* Clone session. */ 
    503520PJ_DEF(pj_status_t) pjsip_auth_clt_clone( pj_pool_t *pool, 
     
    965982                                       pjsip_cached_auth *auth ) 
    966983{ 
    967     pj_pool_t *auth_pool = pjsip_endpt_create_pool(endpt, "regc_auth%p", 1024,  
     984    pj_pool_t *auth_pool = pjsip_endpt_create_pool(endpt, "auth_cli%p", 1024,  
    968985                                                   1024); 
    969986 
     
    11641181            cached_auth = PJ_POOL_ZALLOC_T(sess->pool, pjsip_cached_auth); 
    11651182            cached_auth->pool = pjsip_endpt_create_pool(sess->endpt, 
    1166                                                         "regc_auth%p", 
     1183                                                        "auth_cli%p", 
    11671184                                                        1024, 
    11681185                                                        1024); 
Note: See TracChangeset for help on using the changeset viewer.