use alloca for in function mem

SVN revision: 50781
This commit is contained in:
Sebastian Dransfeld 2010-08-03 19:31:14 +00:00
parent 7f93656d7b
commit 69d0626265
2 changed files with 2 additions and 6 deletions

View File

@ -522,7 +522,7 @@ efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
if (country) maxlen += strlen(country);
if (modifier) maxlen += strlen(modifier);
buf = malloc(maxlen * sizeof(char));
buf = alloca(maxlen * sizeof(char));
if (lang && modifier && country)
{
@ -555,8 +555,6 @@ efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
if (!found)
val = efreet_ini_string_get(ini, key);
FREE(buf);
return val;
}

View File

@ -953,7 +953,7 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
size_t len;
len = strlen(indent) + 3;
new_indent = malloc(sizeof(char *) * len);
new_indent = alloca(sizeof(char *) * len);
snprintf(new_indent, len, "%s ", indent);
EINA_LIST_FOREACH(menu->entries, l, entry)
@ -967,8 +967,6 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
else if (entry->type == EFREET_MENU_ENTRY_HEADER)
INF("%s|---%s", new_indent, entry->name);
}
FREE(new_indent);
}
}