Hazards

Warnings

  • Creates a dangling reference (pointer to memory you don't own)
  • Alias to the stack (pointer to the stack)
  • Alias to the heap (pointer to the heap)
  • Aliasing side effect (change to one thing would be noticed by a different variable or pointer)

Hazards

Errors

  • Assigment via a dangling reference (read/write to the other end of a dangling reference)
  • Double deallocation (deallocate memory that you already deallocated)
  • Memory leak (lose all incoming pointers to heap memory)
  • Delete the stack (deallocate the stack as if it was the heap)