Leak --: ecore_file_dir_get always returns a new buffer.

SVN revision: 38068
This commit is contained in:
Chidambar Zinnoury 2008-12-09 18:28:45 +00:00
parent c8d86791e6
commit c4525334f3
1 changed files with 4 additions and 2 deletions

View File

@ -317,12 +317,14 @@ ecore_file_mv(const char *src, const char *dst)
stat(src, &st);
if (S_ISREG(st.st_mode))
{
const char *dir;
dir = ecore_file_dir_get(dst);
// Since we can't directly rename, try to
// copy to temp file in the dst directory
// and then rename.
snprintf(buf, sizeof(buf), "%s/.%s.tmp.XXXXXX",
ecore_file_dir_get(dst),
ecore_file_file_get(dst));
dir, ecore_file_file_get(dst));
free(dir);
fd = mkstemp(buf);
if (fd < 0)
{