Add sample code for dangling pointers