]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: Release resource before return in BackedObject::download()
authorLi Wang <liwang@ubuntukylin.com>
Wed, 30 Oct 2013 13:32:34 +0000 (21:32 +0800)
committerSage Weil <sage@inktank.com>
Wed, 30 Oct 2013 16:05:12 +0000 (09:05 -0700)
Close file before return

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/tools/rados/rados_sync.cc

index 03293d3402a534388f3f547d599cd53352f59e44..d2d6ab545299be1458c7b263d515fe68074ccabf 100644 (file)
@@ -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)