]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph.cc: close file descriptor in error case
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 13 May 2013 11:59:59 +0000 (13:59 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 14 May 2013 16:39:31 +0000 (18:39 +0200)
CID 717121 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_handle: Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/tools/ceph.cc

index c28c1b200b3e9effab1fca2f618b5c74d4b0ec14..2859c86b1deeddf77d25ca8182c5787d8d3506da 100644 (file)
@@ -194,6 +194,7 @@ static int get_indata(const char *in_file, bufferlist &indata)
     int err = errno;
     derr << "error getting size of in_file '" << in_file << "': "
         << cpp_strerror(err) << dendl;
+    TEMP_FAILURE_RETRY(::close(fd));
     return 1;
   }