add alloc check for calloc

SVN revision: 56152
This commit is contained in:
Mike Blumenkrantz 2011-01-16 01:48:04 +00:00
parent 6d87da8c14
commit d143974767
1 changed files with 17 additions and 19 deletions

View File

@ -37,27 +37,10 @@ e_modapi_init(E_Module *m)
_e_illume_mod_dir = eina_stringshare_add(m->dir);
/* try to initialize the config subsystem */
if (!e_mod_illume_config_init())
{
/* clear module directory variable */
if (_e_illume_mod_dir) eina_stringshare_del(_e_illume_mod_dir);
_e_illume_mod_dir = NULL;
return NULL;
}
if (!e_mod_illume_config_init()) goto err1;
/* try to initialize the policy subsystem */
if (!e_mod_policy_init())
{
/* shutdown the config subsystem */
e_mod_illume_config_shutdown();
/* clear module directory variable */
if (_e_illume_mod_dir) eina_stringshare_del(_e_illume_mod_dir);
_e_illume_mod_dir = NULL;
return NULL;
}
if (!e_mod_policy_init()) goto err2;
/* initialize the keyboard subsystem */
e_mod_kbd_init();
@ -77,6 +60,7 @@ e_modapi_init(E_Module *m)
/* allocate enough zones */
zones = calloc(zcount, sizeof(Ecore_X_Window));
EINA_SAFETY_ON_NULL_GOTO(zones, err3);
zcount = 0;
/* loop the zones and create quickpanels for each one */
@ -111,6 +95,20 @@ e_modapi_init(E_Module *m)
free(zones);
return m;
err3:
E_FREE(_e_illume_kbd);
_e_illume_kbd = NULL;
e_mod_quickpanel_shutdown();
e_mod_kbd_shutdown();
err2:
/* shutdown the config subsystem */
e_mod_illume_config_shutdown();
err1:
/* clear module directory variable */
if (_e_illume_mod_dir) eina_stringshare_del(_e_illume_mod_dir);
_e_illume_mod_dir = NULL;
return NULL;
}
EAPI int