Plug two memory leaks

refs #10963
This commit is contained in:
Jean Flach 2016-01-15 10:11:52 +01:00
parent 46000497cf
commit cb70d97dcf
2 changed files with 4 additions and 2 deletions

View File

@ -561,6 +561,7 @@ String RandomString(int length)
sprintf(output + 2 * i, "%02x", bytes[i]); sprintf(output + 2 * i, "%02x", bytes[i]);
String result = output; String result = output;
delete [] bytes;
delete [] output; delete [] output;
return result; return result;

View File

@ -61,6 +61,7 @@ String Base64::Decode(const String& input)
String ret = String(outbuf, outbuf + len); String ret = String(outbuf, outbuf + len);
BIO_free_all(bio64); BIO_free_all(bio64);
delete [] outbuf;
if (ret.IsEmpty() && !input.IsEmpty()) if (ret.IsEmpty() && !input.IsEmpty())
throw std::invalid_argument("Not a valid base64 string"); throw std::invalid_argument("Not a valid base64 string");