From: Changyeon Lee Date: Thu, 16 Dec 2021 09:01:30 +0000 (+0900) Subject: tbm_bufmgr: fix leak of bo data X-Git-Tag: submit/tizen/20211220.023321~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84b3f20ecc4269bb96ab4ee4bad0b3f921cb2890;p=platform%2Fcore%2Fuifw%2Flibtbm.git tbm_bufmgr: fix leak of bo data Change-Id: I8eb535679f451f0fb64f3f30094cf7801a121184 --- diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c index c478cde..6d7ac0d 100644 --- a/src/tbm_bufmgr.c +++ b/src/tbm_bufmgr.c @@ -1014,6 +1014,7 @@ tbm_bufmgr_internal_alloc_bo_with_bo_data(tbm_bufmgr bufmgr, tbm_bo_data *bo_dat bo2 = tbm_bufmgr_internal_find_bo(bufmgr, bo); if (bo2) { bo2->ref_cnt++; + free(bo->bo_data); free(bo); _tbm_bufmgr_mutex_unlock(); return bo2; @@ -1064,6 +1065,7 @@ tbm_bufmgr_internal_import_bo_with_key(tbm_bufmgr bufmgr, unsigned int key) TBM_TRACE_BO("find bo(%p) ref(%d) key(%d) flag(%s) in list", bo2, bo2->ref_cnt, key, _tbm_flag_to_str(bo2->flags)); bo2->ref_cnt++; + free(bo->bo_data); free(bo); _tbm_set_last_result(TBM_ERROR_NONE); _tbm_bufmgr_mutex_unlock(); @@ -1130,6 +1132,7 @@ tbm_bufmgr_internal_import_bo_with_fd(tbm_bufmgr bufmgr, tbm_fd fd) TBM_TRACE_BO("find bo(%p) ref(%d) fd(%d) flag(%s) in list", bo2, bo2->ref_cnt, fd, _tbm_flag_to_str(bo2->flags)); bo2->ref_cnt++; + free(bo->bo_data); free(bo); _tbm_set_last_result(TBM_ERROR_NONE); _tbm_bufmgr_mutex_unlock();