]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/Crypto.cc: close theoretical memory leak
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 23 Sep 2015 13:01:56 +0000 (15:01 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 29 Jan 2016 20:51:17 +0000 (21:51 +0100)
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 <danny.al-gaaf@bisect.de>
src/auth/Crypto.cc

index 000a5b4739dcaf597f4bd2ae3fc628675d33ca27..61b2ac88217b1e357236fe6a717071fea01e9999 100644 (file)
@@ -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;