3 ms·
> Our code was malloc once, free never. Dangling pointers were by definition impossible. Dangling pointers can arise in other ways: use an uninitialized pointe
by catnaroek 10y ago
> Our code was malloc once, free never. Dangling pointers were by definition impossible.
Dangling pointers can arise in other ways: use an uninitialized pointer variable, take the wrong offset from an otherwise valid pointer, etc.
- vonmoltke 10y agoThose are indeterminate values but they aren't dangling pointers. Dangling pointers are specifically references to an object that has been freed. Plus, the cases you highlighted are programming errors, not reliance on undefined behavior.