]> granicus.if.org Git - icinga2/commitdiff
Plug two memory leaks
authorJean Flach <jean-marcel.flach@netways.de>
Fri, 15 Jan 2016 09:11:52 +0000 (10:11 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 23 Feb 2016 08:57:40 +0000 (09:57 +0100)
refs #10963

lib/base/tlsutility.cpp
lib/remote/base64.cpp

index 0748391b1772e737adfe631f17bbb02255bfd834..d34e465c960362beacb4f8bc3cef946535bc5b25 100644 (file)
@@ -561,6 +561,7 @@ String RandomString(int length)
                sprintf(output + 2 * i, "%02x", bytes[i]);
 
        String result = output;
+       delete [] bytes;
        delete [] output;
 
        return result;
index f818b8bb7c9dc86a2d0629c803359f4a86100f7d..7525a70598194239d868508b6e895971472c648b 100644 (file)
@@ -39,7 +39,7 @@ String Base64::Encode(const String& input)
 
        String ret = String(outbuf, outbuf + len);
        BIO_free_all(bio64);
-       
+
        return ret;
 }
 
@@ -59,7 +59,8 @@ String Base64::Decode(const String& input)
 
        String ret = String(outbuf, outbuf + len);
        BIO_free_all(bio64);
-       
+       delete [] outbuf;
+
        if (ret.IsEmpty() && !input.IsEmpty())
                throw std::invalid_argument("Not a valid base64 string");