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?