From e24a91e9189587c800ef5709c78f1bc0e0ac8419 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Thu, 7 Sep 2017 12:41:40 +0530 Subject: [PATCH] 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 --- src/client/Client.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 1c256cecd9064..a95e6f00c9993 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -12651,7 +12651,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; @@ -12685,6 +12685,7 @@ int Client::ll_write_block(Inode *in, uint64_t blockid, client_lock.Lock(); if (unmounting) { client_lock.Unlock(); + delete onsafe; return -ENOTCONN; } -- 2.39.5