by ffffjfjjfj · 5y ago · 0 comments
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. p2 = p1; p1 = NULL;
However if you are intentionally doing multiple ownership, then yes you can still have problems.