Fix issue detected by static analysis tool 01/190301/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 1 Oct 2018 01:41:18 +0000 (10:41 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 1 Oct 2018 01:41:20 +0000 (10:41 +0900)
WID:56920434 Variable 'type' was passed to function at option.cpp:1007 that can't use negative values is checked for negative value at option.cpp:1012.

Change-Id: Ife4ef5be4398fbb8569b00939e30142ffe039d77
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/option.cpp

index d95dd5e..c3d1096 100644 (file)
@@ -1004,9 +1004,11 @@ static void close_option_window(SCLOptionWindowType type)
 {
     destroy_genlist_item_classes(type);
 #ifdef _TV
-    if (option_elements[type].list_theme) {
-        elm_theme_extension_del(option_elements[type].list_theme, EDJ_FILE);
-        elm_theme_free(option_elements[type].list_theme);
+    if (CHECK_ARRAY_INDEX(type, OPTION_WINDOW_TYPE_MAX)) {
+        if (option_elements[type].list_theme) {
+            elm_theme_extension_del(option_elements[type].list_theme, EDJ_FILE);
+            elm_theme_free(option_elements[type].list_theme);
+        }
     }
 #endif
     if (CHECK_ARRAY_INDEX(type, OPTION_WINDOW_TYPE_MAX)) {