]> 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)
committerJean Flach <jean-marcel.flach@netways.de>
Fri, 15 Jan 2016 09:11:52 +0000 (10:11 +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 3f0a587d726f22ca35d0d66ae9a0f8212579abcc..74ed583809719a288b2e6a8cac7633e63a1196f7 100644 (file)
@@ -39,7 +39,7 @@ String Base64::Encode(const String& input)
 
        String ret = String(outbuf, outbuf + len);
        BIO_free_all(bio64);
-       
+
        return ret;
 }
 
@@ -61,7 +61,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");