]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/internal.cc: close resource leak
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 27 Apr 2015 14:25:51 +0000 (16:25 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 1 Jun 2015 04:59:25 +0000 (06:59 +0200)
Fix for:

CID 1295405 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable req_comp 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 a0b590f4413ba093d1d2644b10fcae1523106b7c..d076ab1120bcae65548036adf3a3379f0d0d2a87 100644 (file)
@@ -3936,6 +3936,7 @@ reprotect_and_return_err:
                               req_comp);
       } else {
        if(ictx->cct->_conf->rbd_skip_partial_discard) {
+         delete req_comp;
          continue;
        }
        req = new AioZero(ictx, p->oid.name, p->objectno, p->offset, p->length,