To prevent certain data from leaking in the face of use-after-free, someone suggested preventing heap allocation for these objects.

To prevent certain data from leaking in the face of use-after-free, someone suggested preventing heap allocation for these objects.
Is https://en.wikibooks.org/wiki/ ... jects a good way to do this, or is there something better?
You already invited:

HOLLIE

Upvotes from:

lease don't. Use smart pointers when you dynamically allocate, and avoid dynamic allocation when unnecessary

If you wanna answer this question please Login or Register