From: Jos Collin Date: Thu, 7 Sep 2017 07:11:40 +0000 (+0530) Subject: client: Delete onsafe X-Git-Tag: v12.2.1~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b0cacf2684bfe8c55282bb7defd54053dc7fa2e8;p=ceph.git client: Delete onsafe Variable "onsafe" going out of scope leaks the storage it points to. This fixes the Coverity Scan CID 1417473. Signed-off-by: Jos Collin (cherry picked from commit e24a91e9189587c800ef5709c78f1bc0e0ac8419) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index ea1c3c2cf5bf..73f03aa07b7a 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -12652,7 +12652,7 @@ int Client::ll_write_block(Inode *in, uint64_t blockid, Cond cond; bool done; int r = 0; - Context *onsafe; + Context *onsafe = nullptr; if (length == 0) { return -EINVAL; @@ -12686,6 +12686,7 @@ int Client::ll_write_block(Inode *in, uint64_t blockid, client_lock.Lock(); if (unmounting) { client_lock.Unlock(); + delete onsafe; return -ENOTCONN; }