Fix issue detected by static analysis tool 42/176242/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 17 Apr 2018 23:29:24 +0000 (08:29 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 18 Apr 2018 00:07:20 +0000 (09:07 +0900)
Return value of a function 'elm_object_part_text_get' is dereferenced at option.cpp:282 without checking, but it is usually checked for this function

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

index 614afad..1e86c8e 100644 (file)
@@ -279,7 +279,8 @@ static char*
 _accessible_body_name_cb(void *data, Evas_Object *obj)
 {
     Evas_Object *layout = (Evas_Object *)data;
-    return strdup(elm_object_part_text_get(layout, "elm.text"));
+    const char *text = elm_object_part_text_get(layout, "elm.text");
+    return text ? strdup(text) : NULL;
 }
 
 static void