From dfd39529977c7b91df149c4ed953c64e3e93ad2c Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 24 Jun 2021 10:56:54 +0900 Subject: [PATCH] tbm_surface_internal: fix the memory leak Change-Id: I0579184c8ebb4215ad27fc6f43f64bd46bbff494 --- src/tbm_surface_internal.c | 2 ++ 1 file changed, 2 insertions(+) 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 */ } -- 2.7.4