]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore: don't leak r in mount
authorSamuel Just <sam.just@inktank.com>
Tue, 25 Sep 2012 22:29:18 +0000 (15:29 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 26 Sep 2012 17:16:24 +0000 (10:16 -0700)
ID 717092: Resource leak (RESOURCE_LEAK)At (40): Handle variable "r" going out
of scope leaks the handle.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/FileStore.cc

index 2b6742b186b0c44eb22310bcb3173f083654763e..2484acd96a85a71fe86400b60c46184004702e79 100644 (file)
@@ -1963,6 +1963,7 @@ int FileStore::mount()
       derr << "FileStore::mount: failed to create current/nosnap" << dendl;
       goto close_current_fd;
     }
+    TEMP_FAILURE_RETRY(::close(r));
   } else {
     // clear nosnap marker, if present.
     ::unlink(nosnapfn);