elementary: fix segmentation faults when using elm_prefs
authorJean Guyomarc'h <jean@guyomarch.bzh>
Fri, 12 Aug 2016 14:20:34 +0000 (16:20 +0200)
committerJean Guyomarc'h <jean@guyomarch.bzh>
Fri, 12 Aug 2016 14:28:32 +0000 (16:28 +0200)
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

src/modules/elementary/prefs/elm_entry.c

index 5253202..966838e 100644 (file)
@@ -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;
 }