From d21a49be25837f00b2a9e3168bd5f7366580766f Mon Sep 17 00:00:00 2001 From: glima Date: Tue, 3 Aug 2010 22:15:02 +0000 Subject: [PATCH] Fixing bad realloc usage. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit By Fabiano Fidêncio. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@50790 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_edit.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 2e32e60..875bc44 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -2716,6 +2716,12 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double tmp = realloc(rp->part->other_desc, sizeof (Edje_Part_Description_Common *) * (rp->part->other_count + 1)); + if (!tmp) + { + free(pd); + return; + } + rp->part->other_desc = tmp; rp->part->other_desc[rp->part->other_count++] = pd; } @@ -2901,6 +2907,12 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl tmp = realloc(rp->part->other_desc, sizeof (Edje_Part_Description_Common *) * (rp->part->other_count + 1)); + if (!tmp) + { + free(pdto); + return EINA_FALSE; + } + rp->part->other_desc = tmp; rp->part->other_desc[rp->part->other_count++] = pdto; pdto->state.name = eina_stringshare_add(to); -- 2.7.4