efreet: remove strdup, use alloca

SVN revision: 47662
This commit is contained in:
Sebastian Dransfeld 2010-04-01 19:32:19 +00:00
parent 127982f44c
commit ede5ac01f6
1 changed files with 5 additions and 2 deletions

View File

@ -1930,7 +1930,11 @@ efreet_desktop_command_file_uri_process(const char *uri)
{
char *tmp, *p;
char hostname[PATH_MAX];
tmp = strdup(uri + 7);
size_t len2;
len2 = strlen(uri + 7) + 1;
tmp = alloca(len2);
memcpy(tmp, uri + 7, len2);
p = strchr(tmp, '/');
if (p)
{
@ -1946,7 +1950,6 @@ efreet_desktop_command_file_uri_process(const char *uri)
path = uri + strlen("file://") + strlen(hostname);
}
}
free(tmp);
}
/* uri:///foo/bar => absolute path /foo/bar on local machine */