wr
hn
Top
New
Best
Ask
Show
Jobs
Back
f
ffffjfjjfj
Joined 5 years ago
Karma
7
Submissions
1
Member since
Dec 21
View on Hacker News
Recent submissions
Comment · 5 years ago
This gives a false sense of security, since the most common use-after-free bugs are if you kept a pointer around. Your method doesn't stop things like this:
void *p1, *p2; malloc(100, &p1); p2 = p1; ... free(&p1); *p2; // oops!
Obviously its trivial in an example like this, but when p2 leaves the lexical scope then there's a problem.