edje: Fix unchecked return value
authorChris Michael <cp.michael@samsung.com>
Thu, 21 Jul 2016 16:29:35 +0000 (12:29 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 21 Jul 2016 16:29:35 +0000 (12:29 -0400)
Coverity reports that we call _circular_dependency_find here without
checking the return value

Fixes Coverity CID1349867

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/edje/edje_calc.c

index 04abc0e..b4a04c4 100644 (file)
@@ -3923,18 +3923,22 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
         Eina_List *l = NULL;
         char *part_name;
         char depends_path[PATH_MAX] = "";
-        _circular_dependency_find(ed, ep, NULL, &clist);
-        strncat(depends_path, ep->part->name,
-                sizeof(depends_path) - strlen(depends_path) - 1);
-        EINA_LIST_FOREACH(clist, l, part_name)
+
+        if (_circular_dependency_find(ed, ep, NULL, &clist))
           {
-             strncat(depends_path, " -> ",
-                     sizeof(depends_path) - strlen(depends_path) - 1);
-             strncat(depends_path, part_name,
+             strncat(depends_path, ep->part->name,
                      sizeof(depends_path) - strlen(depends_path) - 1);
+             EINA_LIST_FOREACH(clist, l, part_name)
+               {
+                  strncat(depends_path, " -> ",
+                          sizeof(depends_path) - strlen(depends_path) - 1);
+                  strncat(depends_path, part_name,
+                          sizeof(depends_path) - strlen(depends_path) - 1);
+               }
+             ERR("Circular dependency in the group '%s' : %s",
+                 ed->group, depends_path);
+             eina_list_free(clist);
           }
-        ERR("Circular dependency in the group '%s' : %s", ed->group, depends_path);
-        eina_list_free(clist);
 #endif
         return;
      }