Fix segfault related to strdup.

Summary: This patch fixes a segfault that happens when you create a flipselector theme without an "elm.top" part.

Reviewers: cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D156
This commit is contained in:
Leif Middelschulte 2013-06-04 12:09:47 +02:00
parent 152deb9a9a
commit d031934ff4
1 changed files with 3 additions and 1 deletions

View File

@ -62,8 +62,10 @@ _elm_flipselector_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSE
if (sd->sentinel)
{
const char *label = elm_object_item_text_get(DATA_GET(sd->sentinel));
const char *src = elm_layout_text_get(obj, "elm.top");
tmp = strdup(elm_layout_text_get(obj, "elm.top"));
if (src)
tmp = strdup(src);
elm_layout_text_set(obj, "elm.top", label);
}