I came up with similar, but, before you refer to node and node->next, you definitely, need to check whether they are valid pointers.

```
if(nullptr != node && nullptr != node->next){
ListNode* p = node->next;
node->val = node->next->val;
node->next = node->next->next;
delete p;
}
```