From: Danny Al-Gaaf Date: Wed, 23 Sep 2015 13:01:56 +0000 (+0200) Subject: auth/Crypto.cc: close theoretical memory leak X-Git-Tag: v10.0.4~86^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b43497c6116f0d8b822d93369f61666997be387d;p=ceph.git auth/Crypto.cc: close theoretical memory leak Fix for: CID 1296382 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable ckh going out of scope leaks the storage it points to. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index 000a5b4739dc..61b2ac88217b 100644 --- a/src/auth/Crypto.cc +++ b/src/auth/Crypto.cc @@ -354,6 +354,7 @@ CryptoKeyHandler *CryptoAES::get_key_handler(const bufferptr& secret, ostringstream oss; if (ckh->init(secret, oss) < 0) { error = oss.str(); + delete ckh; return NULL; } return ckh;