diff mbox

[2/2] mds: Release resource before return

Message ID 29600d7aede767b7f10879bd858ec1003cadc477.1384760071.git.liwang@ubuntukylin.com (mailing list archive)
State New, archived
Headers show

Commit Message

Li Wang Nov. 18, 2013, 7:40 a.m. UTC
Close file before return.
Fix coverity issue: CID 1019571

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reported-by: Xianxia Xiao <xianxiaxiao@ubuntukylin.com>
---
 src/mds/MDCache.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index ae59c26..17d4ce4 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -11731,7 +11731,7 @@  void MDCache::dump_cache(const char *fn)
     std::string s = ss.str();
     r = safe_write(fd, s.c_str(), s.length());
     if (r < 0)
-      return;
+      goto out;
 
     list<CDir*> dfs;
     in->get_dirfrags(dfs);