ALL: Finalize edge case memory leak potential in memory allocation
- Dominant language
- C#
- Stars
- 83
- Forks
- 50
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 7
Description
The C# `ProtectedMemorySecret` initialization has try/catch logic around the initial copying of the source data to handle edge case failures that could lead to memory leaks (not dealloc'ing). This seems like something that should be in the Java implementation as well. Additionally, there is an inconsistency in the aforementioned C# cleanup handling that is different than the regular cleanup/close path (not doing the pointer exchange).
We had untested changes around this that didn't make it into this public repo. We should normalize the approaches between the languages and update the Secure Memory documentation to reflect it accordingly. May be good opportunity to also verify whether the pointer exchanges are needed (if we're clearing/deallocating anyway).
Contributor guide
Assessment
This issue has not been assessed yet.