Re:The NSA advises move to memory-safe languages
by tobias12345 on Tuesday December 12, 2023 @10:08AM
(#38613124)
RAII is great, but unfortunately it breaks down when the resource it manages leaks out of the RAII type.
E.g. Whenever handing out the raw pointer stored in a unique_ptr, the code receiving that raw pointer can delete it, which will very likely lead to a use after free and certainly to a double free issue.
E.g. Whenever handing out the raw pointer stored in a unique_ptr, the code receiving that raw pointer can delete it, which will very likely lead to a use after free and certainly to a double free issue.