Fix the dangling pointer.