Fix prevent issues 48/40648/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 2 Jun 2015 11:27:05 +0000 (20:27 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Sun, 7 Jun 2015 08:44:51 +0000 (17:44 +0900)
Change-Id: I4d359f48283ca5ba26a533e602f09978179d20c2
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
src/tbm_bufmgr.c

index 4d7ddbf..8f24f91 100644 (file)
@@ -1234,7 +1234,10 @@ tbm_bo_import (tbm_bufmgr bufmgr, unsigned int key)
 
     bo = calloc (1, sizeof(struct _tbm_bo));
     if(!bo)
+    {
+        pthread_mutex_unlock (&bufmgr->lock);
         return NULL;
+    }
 
     bo->bufmgr = bufmgr;
 
@@ -1304,7 +1307,10 @@ tbm_bo_import_fd  (tbm_bufmgr bufmgr, tbm_fd fd)
 
     bo = calloc (1, sizeof(struct _tbm_bo));
     if(!bo)
+    {
+        pthread_mutex_unlock (&bufmgr->lock);
         return NULL;
+    }
 
     bo->bufmgr = bufmgr;