From: Jean Guyomarc'h Date: Fri, 12 Aug 2016 14:20:34 +0000 (+0200) Subject: elementary: fix segmentation faults when using elm_prefs X-Git-Tag: upstream/1.20.0~4813 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6b82896365e6de43aca745385963a0673f18d46;p=platform%2Fupstream%2Fefl.git elementary: fix segmentation faults when using elm_prefs There are several cases of failure: - if regex is NULL, regfree(regex) may lead to segmentation fault (undefined behaviour, as specified in POSIX.1) - if regex is not NULL, there are cases of use-after-free. @fix --- diff --git a/src/modules/elementary/prefs/elm_entry.c b/src/modules/elementary/prefs/elm_entry.c index 5253202..966838e 100644 --- a/src/modules/elementary/prefs/elm_entry.c +++ b/src/modules/elementary/prefs/elm_entry.c @@ -207,7 +207,6 @@ elm_prefs_entry_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED, elm_entry_markup_filter_append(obj, elm_entry_filter_limit_size, &limit); elm_layout_text_set(obj, NULL, spec.s.placeholder); - regfree(regex); return obj; }