Re:Defensive Programming
by ffffjfjjfj on Wednesday December 23, 2020 @03:07PM
(#25521590)
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:
Obviously its trivial in an example like this, but when p2 leaves the lexical scope then there's a problem.
[ Parent
| on HN ]