-
Notifications
You must be signed in to change notification settings - Fork 86
avoid leaving hanging object references in helper functions #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@mattsb42-aws, I am interested in solving this issue. |
Hi @abdulsmapara, thanks for the interest! This is referring to the top-level single-step interfaces for encrypt[1] and decrypt[2]. The concern is that the reference to the attribute on the stream object will keep the stream object around in memory. This is not a concern for the streaming interface because in that case the caller has direct control of the stream object. Poking around at this a bit today, actually the only thing that we would need to do here is to use [1] aws-encryption-sdk-python/src/aws_encryption_sdk/__init__.py Lines 84 to 87 in 82e2156
[2] aws-encryption-sdk-python/src/aws_encryption_sdk/__init__.py Lines 143 to 146 in 82e2156
|
I think this PR should complete the task ! |
The
encrypt
anddecrypt
helper functions in the top-levelaws_encryption_sdk
module currently return the header object from theEncryptionStream
objects. To avoid any possibility of those objects not being released for garbage collection because of active reference, we should copy the header object and return the copy.The text was updated successfully, but these errors were encountered: