Skip to contentSkip to conversation

ceph: Release resource before return in BackedObject::download()

PATCH New Li Wang 1 participant 1 message Oct 30, 2013

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 ceph: Release resource before return in BackedObject::download()

Close file before return

---
 src/tools/rados/rados_sync.cc |    1 +
 1 file changed, 1 insertion(+)
src/tools/rados/rados_sync.cc +1 -0
index 03293d3..d2d6ab5 100644
@@ -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)
Signature · 1 line
1.7.9.5