Changeset 4008


Ignore:
Timestamp:
Apr 3, 2012 4:03:19 AM (7 years ago)
Author:
nanang
Message:

Re #1453: fixed memory leak in pjmedia_vid_codec_mgr_set_default_param() caused by unreleased old pool when the new codec param is not NULL (thanks Faba Aa for the report).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/vid_codec.c

    r3956 r4008  
    723723    /* Update codec default param */ 
    724724    p->param = pjmedia_vid_codec_param_clone(pool, param); 
    725     if (!p) 
     725    if (!p->param) 
    726726        return PJ_EINVAL; 
     727 
    727728    codec_desc->def_param = p; 
    728729 
    729730    pj_mutex_unlock(mgr->mutex); 
     731 
     732    /* Release old pool at the very end, as application tends to apply changes 
     733     * to the existing/old codec param fetched using 
     734     * pjmedia_vid_codec_mgr_get_default_param() which doesn't do deep clone. 
     735     */ 
     736    if (old_pool) 
     737        pj_pool_release(old_pool); 
    730738 
    731739    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.