Since that code isn't indented (because you didn't use code tags, which you can get from the <> button to the right of the editing box), it's really tedious to read.
But, somewhere, you're attempting to read memory you don't have access to.
Prev is set to point to the same memory as curr. After you delete the memory pointed to by curr, prev also points to free memory, yet you attempt to dereference it. Did you mean to make a copy of the object pointed to by curr when you did that assignment operation?