0

Using Crypto++, example is :

StreamTransformationFilter stfEncryptor(cbcEncryption, new StringSink( ciphertext ) );
stfEncryptor.Put( reinterpret_cast<const unsigned char*>( plaintext.c_str() ), plaintext.length() + 1 );
stfEncryptor.MessageEnd();

Why use new to allocate memory but no free memory? Will it lead to memory leak?

jww
  • 97,681
  • 90
  • 411
  • 885
  • Hi peng Yang and welcome to Stack Overflow. This question, as currently written, has a number of problems that ultimately make it unreadable, hard to find via search, and difficult for others to answer due to lack of context and clarity. Please give it a simple title, some formatting, more complete code samples, and an intro with background info on what this is for and details on what precisely you are asking and expecting. – Seth Holladay May 25 '17 at 04:07
  • 2
    Possible duplicate of [Crypto++ explicit destruction during encryption/decryption?](https://stackoverflow.com/a/42546353/608639) – jww May 25 '17 at 04:49

0 Answers0