From d31284733637b207690735461851c243f3e1a165 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Mon, 27 Apr 2015 16:25:51 +0200 Subject: [PATCH] librbd/internal.cc: close resource leak 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 --- src/librbd/internal.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index a0b590f4413ba..d076ab1120bca 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -3936,6 +3936,7 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type, 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,