]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Release resource before return
authorLi Wang <liwang@ubuntukylin.com>
Mon, 18 Nov 2013 07:40:19 +0000 (15:40 +0800)
committerJosh Durgin <josh.durgin@inktank.com>
Mon, 25 Nov 2013 21:57:40 +0000 (13:57 -0800)
Close file before return.
Fix coverity issue: CID 1019571

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reported-by: Xianxia Xiao <xianxiaxiao@ubuntukylin.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
src/mds/MDCache.cc

index ae59c26ee13bf37b10582480cfe8550dd0774146..17d4ce49188fa7001c1eefc2b88936778da658dd 100644 (file)
@@ -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);