summaryrefslogtreecommitdiff
path: root/legacy/efreet
diff options
context:
space:
mode:
authorDan Sinclair <dj2>2008-03-18 04:01:41 +0000
committerDan Sinclair <dj2@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2008-03-18 04:01:41 +0000
commita81974fe1fdf04e9da0dd155cb3a1f4a146a0740 (patch)
treed2a2b34d3aefa19174f8930fbf8ad9b4dba41879 /legacy/efreet
parent7f9e3f4cfd30a2a46e4b4713b31cf0e24cef4224 (diff)
- patch from Michael <sECuRE+e17 at twice-irc dot de> to fix possible mem
leak in efreet_desktop SVN revision: 34050
Diffstat (limited to 'legacy/efreet')
-rw-r--r--legacy/efreet/src/lib/efreet_desktop.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/legacy/efreet/src/lib/efreet_desktop.c b/legacy/efreet/src/lib/efreet_desktop.c
index d3623bfcba..468e7af435 100644
--- a/legacy/efreet/src/lib/efreet_desktop.c
+++ b/legacy/efreet/src/lib/efreet_desktop.c
@@ -1806,8 +1806,12 @@ efreet_desktop_command_path_absolute(const char *path)
1806 /* relative url */ 1806 /* relative url */
1807 if (path[0] != '/') 1807 if (path[0] != '/')
1808 { 1808 {
1809 buf = malloc(size); 1809 if (!(buf = malloc(size))) return NULL;
1810 if (!getcwd(buf, size)) return NULL; 1810 if (!getcwd(buf, size))
1811 {
1812 FREE(buf);
1813 return NULL;
1814 }
1811 len = strlen(buf); 1815 len = strlen(buf);
1812 1816
1813 if (buf[len-1] != '/') buf = efreet_string_append(buf, &size, &len, "/"); 1817 if (buf[len-1] != '/') buf = efreet_string_append(buf, &size, &len, "/");
@@ -1816,6 +1820,6 @@ efreet_desktop_command_path_absolute(const char *path)
1816 return buf; 1820 return buf;
1817 } 1821 }
1818 1822
1819 /* just dup an alreaady absolute buffer */ 1823 /* just dup an already absolute buffer */
1820 return strdup(path); 1824 return strdup(path);
1821} 1825}