From: SooChan Lim Date: Thu, 24 Jun 2021 01:56:54 +0000 (+0900) Subject: tbm_surface_internal: fix the memory leak X-Git-Tag: submit/tizen/20210624.054931~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfd39529977c7b91df149c4ed953c64e3e93ad2c;p=platform%2Fcore%2Fuifw%2Flibtbm.git tbm_surface_internal: fix the memory leak Change-Id: I0579184c8ebb4215ad27fc6f43f64bd46bbff494 --- diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index c9a2e47..251b975 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -797,6 +797,7 @@ _tbm_surface_internal_create_surface(tbm_bufmgr bufmgr, int width, int height, i if (!surf->surface_data) { TBM_ERR("tbm_module_alloc_surface_data failed. width:%d height:%d format:%d error:%s", width, height, format, tbm_error_str(*error)); + _tbm_surface_internal_free(surf); return NULL; } } @@ -832,6 +833,7 @@ _tbm_surface_internal_import_surface(tbm_bufmgr bufmgr, int width, int height, i /* LCOV_EXCL_START */ TBM_ERR("tbm_module_import_surface_data failed. width:%d height:%d format:%d error:%s", width, height, format, tbm_error_str(*error)); + _tbm_surface_internal_free(surf); return NULL; /* LCOV_EXCL_STOP */ }