CID 717088: Resource leak (RESOURCE_LEAK)At (11): Handle variable "tmpfd" going
out of scope leaks the handle.
Signed-off-by: Samuel Just <sam.just@inktank.com>
*_dout << "Got error " + cpp_strerror(ret) + ". ";
*_dout << "If you are using ext3 or ext4, be sure to mount the underlying "
<< "file system with the 'user_xattr' option." << dendl;
+ TEMP_FAILURE_RETRY(::close(tmpfd));
return -ENOTSUP;
}
return -errno;
int r = _test_fiemap();
- if (r < 0)
+ if (r < 0) {
+ TEMP_FAILURE_RETRY(::close(fd));
return -r;
+ }
struct statfs st;
r = ::fstatfs(fd, &st);
- if (r < 0)
+ if (r < 0) {
+ TEMP_FAILURE_RETRY(::close(fd));
return -errno;
+ }
blk_size = st.f_bsize;
#if defined(__linux__)