Properly clean up memory in erase_log

erase_log() wasn't nullifying a pointer after deallocating the memory it
pointed to.