mapleFU commented on code in PR #43222:
URL: https://github.com/apache/arrow/pull/43222#discussion_r1674145456


##########
cpp/src/parquet/encryption/internal_file_encryptor.cc:
##########
@@ -150,8 +150,8 @@ encryption::AesEncryptor* 
InternalFileEncryptor::GetMetaAesEncryptor(
   int key_len = static_cast<int>(key_size);
   int index = MapKeyLenToEncryptorArrayIndex(key_len);
   if (meta_encryptor_[index] == nullptr) {
-    meta_encryptor_[index].reset(
-        encryption::AesEncryptor::Make(algorithm, key_len, true, 
&all_encryptors_));
+    meta_encryptor_[index] = encryption::AesEncryptor::Make(algorithm, 
key_len, true);
+    all_encryptors_.push_back(meta_encryptor_[index].get());

Review Comment:
   All also we can remove `all_encryptors_`, and do:
   
   ```
   void InternalFileEncryptor::WipeOutEncryptionKeys() {
     properties_->WipeOutEncryptionKeys();
   
     for (auto const& i : meta_encryptor_) {
       if (i != nullptr) i->WipeOut();
     }
     for (auto const& i : data_encryptor_) {
       if (i != nullptr) i->WipeOut();
     }
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to