Edje_Edit: fix defect found by Coverity in ...state_tween_insert_at
authorVitalii Vorobiov <vi.vorobiov@samsung.com>
Fri, 19 Feb 2016 11:22:07 +0000 (11:22 +0000)
committerVitalii Vorobiov <vi.vorobiov@samsung.com>
Fri, 19 Feb 2016 11:22:07 +0000 (11:22 +0000)
Check constraits before creating image structures

CID 1351558

src/lib/edje/edje_edit.c

index 96d8cf5..7f30907 100644 (file)
@@ -8761,7 +8761,10 @@ edje_edit_state_tween_insert_at(Evas_Object *obj, const char *part, const char *
    img = (Edje_Part_Description_Image *)pd;
 
    if ((unsigned)place > img->image.tweens_count)
-     return EINA_FALSE;
+     {
+        free(i);
+        return EINA_FALSE;
+     }
 
    /* add to tween list */
    tmp = realloc(img->image.tweens,