summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-10-20 18:30:03 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-10-20 18:30:03 +0900
commit7f12ca0f84620443f59bbc6d57cd265ea05c7f62 (patch)
treeb788f9cd0a8e5cde53363324da31fdc1bb948e8a
parentb410417d689762bc96b4ac7662877fb29f425625 (diff)
elm config - check if _elm_config is null - makes coveirty happy
it really should never be null though... or else really bad things just happened (allocations failed etc.)
-rw-r--r--src/lib/elementary/elm_config.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 19332cac5d..a79899c610 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -1695,6 +1695,7 @@ _config_load(void)
1695 // why are these here? well if they are, it means you can make a gui 1695 // why are these here? well if they are, it means you can make a gui
1696 // config recovery app i guess... 1696 // config recovery app i guess...
1697 _elm_config = ELM_NEW(Elm_Config); 1697 _elm_config = ELM_NEW(Elm_Config);
1698 if (!_elm_config) return;
1698 _elm_config->config_version = ELM_CONFIG_VERSION; 1699 _elm_config->config_version = ELM_CONFIG_VERSION;
1699 _elm_config->engine = NULL; 1700 _elm_config->engine = NULL;
1700 _elm_config->accel = NULL; 1701 _elm_config->accel = NULL;
@@ -1829,7 +1830,7 @@ _elm_config_reload_do(void)
1829 prev_config = _elm_config; 1830 prev_config = _elm_config;
1830 _elm_config = NULL; 1831 _elm_config = NULL;
1831 _config_load(); 1832 _config_load();
1832 if (prev_config) 1833 if ((prev_config) && (_elm_config))
1833 { 1834 {
1834#define KEEP_VAL(xxx) \ 1835#define KEEP_VAL(xxx) \
1835 if (prev_config->priv.xxx) { \ 1836 if (prev_config->priv.xxx) { \
@@ -2022,7 +2023,7 @@ _elm_config_reload_do(void)
2022 _elm_config->priv = prev_config->priv; 2023 _elm_config->priv = prev_config->priv;
2023 _config_free(prev_config); 2024 _config_free(prev_config);
2024 } 2025 }
2025 _env_get(); 2026 if (_elm_config) _env_get();
2026} 2027}
2027 2028
2028static void 2029static void
@@ -4100,7 +4101,7 @@ _elm_config_init(void)
4100 _elm_config_profile_derived_init(); 4101 _elm_config_profile_derived_init();
4101 _profile_fetch_from_conf(); 4102 _profile_fetch_from_conf();
4102 _config_load(); 4103 _config_load();
4103 _env_get(); 4104 if (_elm_config) _env_get();
4104 ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del); 4105 ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);
4105 ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del); 4106 ELM_SAFE_FREE(_elm_gl_preference, eina_stringshare_del);
4106 _translation_init(); 4107 _translation_init();