aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_file/ecore_file.c
diff options
context:
space:
mode:
authorChidambar Zinnoury <illogict@online.fr>2008-12-09 18:28:45 +0000
committerChidambar Zinnoury <illogict@online.fr>2008-12-09 18:28:45 +0000
commitc4525334f3d424e418a8e54b91af0f7cc5d1b664 (patch)
tree9bf9a1d8bba1cef0249f9b7b6969df813a4145a6 /legacy/ecore/src/lib/ecore_file/ecore_file.c
parentInclude stdio.h so ecore_getopt_help() is fine. (diff)
downloadefl-c4525334f3d424e418a8e54b91af0f7cc5d1b664.tar.gz
Leak --: ecore_file_dir_get always returns a new buffer.
SVN revision: 38068
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_file/ecore_file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c
index 1c9bcb6d09..a04ddc5f20 100644
--- a/legacy/ecore/src/lib/ecore_file/ecore_file.c
+++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c
@@ -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)
{