Fix prevent issues 95/43695/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 6 Jul 2015 10:15:00 +0000 (19:15 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 13 Jul 2015 08:32:12 +0000 (17:32 +0900)
Change-Id: I3fba9a4cf8310cec2c419df251ff3cf9ad6a2305
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
packaging/libtbm.spec
src/tbm_bufmgr.c

index 04f26c2..bb538e3 100644 (file)
@@ -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
index 7519676..a944d40 100644 (file)
@@ -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);