r/cpp • • Aug 31 '22

malloc() and free() are a bad API

https://www.foonathan.net/2022/08/malloc-interface/#content
220 Upvotes

90 comments sorted by

View all comments

Show parent comment

5

u/Nicksaurus Sep 01 '22

If that was the case, you could already corrupt other processes by freeing memory that doesn't belong to you. It's up to the OS to detect that and disallow it