thiep pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5f2e4b9197cb96184c8e8acde10b5d8da8ac8662

commit 5f2e4b9197cb96184c8e8acde10b5d8da8ac8662
Author: Thiep Ha <thie...@gmail.com>
Date:   Wed Jun 14 10:40:27 2017 +0900

    elm config: add more NULL check
    
    Add NULL check when we cannot allocate memory.
---
 src/lib/elementary/elm_config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 1d24f17346..f6bc5a8ee6 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -1023,6 +1023,7 @@ _elm_config_font_overlay_set(const char    *text_class,
 
    /* the text class doesn't exist */
    efd = calloc(1, sizeof(Elm_Font_Overlay));
+   if (!efd) return;
    efd->text_class = eina_stringshare_add(text_class);
    efd->font = eina_stringshare_add(font);
    efd->size = size;
@@ -1287,6 +1288,7 @@ _elm_config_color_set(const char *palette_name,
           continue;
 
         color = calloc(1, sizeof(Elm_Color_RGBA));
+        if (!color) continue;
         color->r = r;
         color->g = g;
         color->b = b;
@@ -3753,7 +3755,7 @@ _translation_init(void)
     * en_/C where translating only parts of the interface make some
     * sense).
     */
-   if (msg_locale)
+   if (msg_locale && cur_dom)
      _elm_config->translate = !(strcmp (cur_dom, "messages") &&
            !*trans_comment && strncmp (msg_locale, "en_", 3) &&
            strcmp (msg_locale, "C"));

-- 


Reply via email to