- patch from Michael <sECuRE+e17 at twice-irc dot de> to fix possible mem

leak in efreet_desktop


SVN revision: 34050
This commit is contained in:
Dan Sinclair 2008-03-18 04:01:41 +00:00 committed by Dan Sinclair
parent 7f9e3f4cfd
commit a81974fe1f
1 changed files with 7 additions and 3 deletions

View File

@ -1806,8 +1806,12 @@ efreet_desktop_command_path_absolute(const char *path)
/* relative url */
if (path[0] != '/')
{
buf = malloc(size);
if (!getcwd(buf, size)) return NULL;
if (!(buf = malloc(size))) return NULL;
if (!getcwd(buf, size))
{
FREE(buf);
return NULL;
}
len = strlen(buf);
if (buf[len-1] != '/') buf = efreet_string_append(buf, &size, &len, "/");
@ -1816,6 +1820,6 @@ efreet_desktop_command_path_absolute(const char *path)
return buf;
}
/* just dup an alreaady absolute buffer */
/* just dup an already absolute buffer */
return strdup(path);
}