diff options
author | Thiep Ha <thiepha@gmail.com> | 2017-06-14 10:40:27 +0900 |
---|---|---|
committer | Thiep Ha <thiepha@gmail.com> | 2017-06-14 10:44:39 +0900 |
commit | 5f2e4b9197cb96184c8e8acde10b5d8da8ac8662 (patch) | |
tree | bce669f21fe326f2d77631e04bab75a24ea196d9 | |
parent | b13a73ae87b0ec383907a821b636881523657ed3 (diff) | |
download | efl-5f2e4b9197cb96184c8e8acde10b5d8da8ac8662.tar.gz |
elm config: add more NULL check
Add NULL check when we cannot allocate memory.
-rw-r--r-- | src/lib/elementary/elm_config.c | 4 |
1 files changed, 3 insertions, 1 deletions
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")); |