Fix svace issues:DEREF_OF_NULL 48/55048/1 accepted/tizen/mobile/20151221.223931 accepted/tizen/tv/20151221.223952 accepted/tizen/wearable/20151221.224057 submit/tizen/20151221.114412
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 21 Dec 2015 11:24:55 +0000 (20:24 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 21 Dec 2015 11:25:54 +0000 (20:25 +0900)
Change-Id: Ibaeb27a1f9c0be38ab73ab9555999d476598848f
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
src/tbm_surface_internal.c

index 755c83d..e18ba3c 100755 (executable)
@@ -548,8 +548,10 @@ tbm_surface_h tbm_surface_internal_create_with_flags(int width, int height, int
                }
                surf->bos[i] = tbm_bo_alloc(mgr, bo_size, flags);
                if (!surf->bos[i]) {
-                       for (j = 0; j < i; j++)
-                               tbm_bo_unref(surf->bos[j]);
+                       for (j = 0; j < i; j++) {
+                               if (!surf->bos[j])
+                                       tbm_bo_unref(surf->bos[j]);
+                       }
 
                        free(surf);
                        surf = NULL;