From: Changyeon Lee Date: Mon, 6 Jul 2015 10:15:00 +0000 (+0900) Subject: Fix prevent issues X-Git-Tag: accepted/tizen/mobile/20150715.003251~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F43695%2F1;p=platform%2Fcore%2Fuifw%2Flibtbm.git Fix prevent issues Change-Id: I3fba9a4cf8310cec2c419df251ff3cf9ad6a2305 Signed-off-by: Changyeon Lee --- diff --git a/packaging/libtbm.spec b/packaging/libtbm.spec index 04f26c2..bb538e3 100644 --- a/packaging/libtbm.spec +++ b/packaging/libtbm.spec @@ -3,7 +3,7 @@ Name: libtbm Version: 1.1.4 -Release: 1 +Release: 2 License: MIT Summary: The library for Tizen Buffer Manager Group: System/Libraries diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c index 7519676..a944d40 100644 --- a/src/tbm_bufmgr.c +++ b/src/tbm_bufmgr.c @@ -908,6 +908,9 @@ tbm_bufmgr_init (int fd) if (!gBufMgr) { _tbm_set_last_result (TBM_BO_ERROR_HEAP_ALLOC_FAILED); + if (fd_flag) + close(fd); + pthread_mutex_unlock (&gLock); return NULL; } @@ -941,6 +944,7 @@ tbm_bufmgr_init (int fd) TBM_LOG ("[libtbm:%d] " "error : Fail to load bufmgr backend\n", getpid()); + close (gBufMgr->fd); free (gBufMgr); gBufMgr = NULL; pthread_mutex_unlock (&gLock); @@ -976,6 +980,7 @@ tbm_bufmgr_init (int fd) gBufMgr->backend->bufmgr_deinit (gBufMgr->backend->priv); tbm_backend_free (gBufMgr->backend); dlclose (gBufMgr->module_data); + close (gBufMgr->fd); free (gBufMgr); gBufMgr = NULL; pthread_mutex_unlock (&gLock); @@ -993,6 +998,7 @@ tbm_bufmgr_init (int fd) tbm_backend_free (gBufMgr->backend); pthread_mutex_destroy (&gBufMgr->lock); dlclose (gBufMgr->module_data); + close (gBufMgr->fd); free (gBufMgr); gBufMgr = NULL; pthread_mutex_unlock (&gLock);