[PATCH] ceph: Release resource before return in BackedObject::download()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Close file before return

Signed-off-by: Li Wang <liwang@xxxxxxxxxxxxxxx>
---
 src/tools/rados/rados_sync.cc |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tools/rados/rados_sync.cc b/src/tools/rados/rados_sync.cc
index 03293d3..d2d6ab5 100644
--- a/src/tools/rados/rados_sync.cc
+++ b/src/tools/rados/rados_sync.cc
@@ -579,6 +579,7 @@ int BackedUpObject::download(IoCtx &io_ctx, const char *path)
     if (rlen < 0) {
       cerr << ERR_PREFIX << "download: io_ctx.read(" << rados_name << ") returned "
 	   << rlen << std::endl;
+      fclose(fp);
       return rlen;
     }
     if (rlen < CHUNK_SZ)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux