From 3bd1a372a038a70cc007f8f8c9a5c8acac96f9b4 Mon Sep 17 00:00:00 2001 From: "www220@tom.com" Date: Fri, 11 Sep 2015 19:34:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3mkdir=20lseek=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8F=A5=E6=9F=84=E4=B8=8D=E9=87=8A=E6=94=BE?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/src/dfs_posix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 250f6eaf7f..c379d5c969 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -230,6 +230,7 @@ off_t lseek(int fd, off_t offset, int whence) break; default: + fd_put(d); rt_set_errno(-DFS_STATUS_EINVAL); return -1; @@ -237,6 +238,7 @@ off_t lseek(int fd, off_t offset, int whence) if (offset < 0) { + fd_put(d); rt_set_errno(-DFS_STATUS_EINVAL); return -1; @@ -457,6 +459,7 @@ int mkdir(const char *path, mode_t mode) if (result < 0) { + fd_put(d); fd_put(d); rt_set_errno(result); @@ -465,6 +468,7 @@ int mkdir(const char *path, mode_t mode) dfs_file_close(d); fd_put(d); + fd_put(d); return 0; }