summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2019-01-30 12:03:20 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-30 13:33:49 +0100
commit4eda1ea38ece822b5202fc03ad2309e85bd698b2 (patch)
tree975345decdd14433f8f57c90f5bf2396698998f4 /src/lib/eo/eo.c
parentfe29a7a06db2935d006643429c3b204afcdad1af (diff)
eo: check memory allocation of table data
Memory allocation is checked for the given domain's table data like other cases for main and shared table data. Differential Revision: https://phab.enlightenment.org/D7810
Diffstat (limited to 'src/lib/eo/eo.c')
-rw-r--r--src/lib/eo/eo.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 44a17ae..3e4ac6c 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -2470,21 +2470,26 @@ EAPI Eina_Bool
2470efl_domain_switch(Efl_Id_Domain domain) 2470efl_domain_switch(Efl_Id_Domain domain)
2471{ 2471{
2472 Eo_Id_Data *data = _eo_table_data_get(); 2472 Eo_Id_Data *data = _eo_table_data_get();
2473 Eo_Id_Data *new_data;
2473 if ((domain < EFL_ID_DOMAIN_MAIN) || (domain > EFL_ID_DOMAIN_THREAD) || 2474 if ((domain < EFL_ID_DOMAIN_MAIN) || (domain > EFL_ID_DOMAIN_THREAD) ||
2474 (domain == EFL_ID_DOMAIN_SHARED)) 2475 (domain == EFL_ID_DOMAIN_SHARED))
2475 { 2476 {
2476 ERR("Invalid domain %i being switched to", domain); 2477 ERR("Invalid domain %i being switched to", domain);
2477 return EINA_FALSE; 2478 return EINA_FALSE;
2478 } 2479 }
2479 if (data) 2480 if ((data) && (data->local_domain == domain))
2481 return EINA_TRUE;
2482
2483 new_data = _eo_table_data_new(domain);
2484 if (!new_data)
2480 { 2485 {
2481 if (data->local_domain == domain) return EINA_TRUE; 2486 ERR("Could not allocate domain %i table data", domain);
2482 _eo_free_ids_tables(data); 2487 return EINA_FALSE;
2483 } 2488 }
2484 data = _eo_table_data_new(domain); 2489 if (data) _eo_free_ids_tables(data);
2485 data->local_domain = domain; 2490 new_data->local_domain = domain;
2486 data->domain_stack[data->stack_top] = domain; 2491 new_data->domain_stack[new_data->stack_top] = domain;
2487 eina_tls_set(_eo_table_data, data); 2492 eina_tls_set(_eo_table_data, new_data);
2488 return EINA_TRUE; 2493 return EINA_TRUE;
2489} 2494}
2490 2495