efreet: use alloca

malloc + dir in same function -> alloca

SVN revision: 73052
This commit is contained in:
Sebastian Dransfeld 2012-06-29 20:35:23 +00:00
parent 0d1c4661ab
commit a6fc2bf1bb
1 changed files with 1 additions and 3 deletions

View File

@ -215,12 +215,10 @@ efreet_dir_get(const char *key, const char *fallback)
user = efreet_home_dir_get();
len = strlen(user) + strlen(fallback) + 1;
dir = malloc(len);
if (!dir) return NULL;
dir = alloca(len);
snprintf(dir, len, "%s%s", user, fallback);
t = eina_stringshare_add(dir);
FREE(dir);
}
else t = eina_stringshare_add(dir);