]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/internal.cc: fix resource leak 296/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 16 May 2013 13:56:12 +0000 (15:56 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 17 May 2013 11:54:09 +0000 (13:54 +0200)
Call release() on librados::AioCompletion to free storage before
leave the loop or call new again.

CID 1021213 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rados_completion" going out of scope leaks
  the storage it points to.

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

index d845886b25f92be483c8c9774b531057fe2bcb3a..d4a25e1ed8a07bdc1b2529cb93472f5806f04ecc 100644 (file)
@@ -345,6 +345,7 @@ namespace librbd {
       ictx->data_ctx.aio_operate(oid, rados_completion, &op);
       ldout(cct, 10) << "scheduling selfmanaged_snap_rollback on "
                     << oid << " to " << snap_id << dendl;
+      rados_completion->release();
       prog_ctx.update_progress(i * bsize, numseg * bsize);
     }