The problem isn't setting the pointer to 0, it's forgetting to free that pointer. If you wrote the value zero into it, you either did it accidentally, or, you meant to, which you'll find on review. I would add a comment above where you set the pointer to zero, explaining why it's being to set to zero. It wouldn't recommend randomly overwriting variables and pointers, unless you're doing something obvious with line of sight. A good rule of thumb is 50% of your code base should be comment, for that reason.
Do I set things to null for garbage collectors? Usually, depending on the language, when I'm done with them, since it marks the memory as truly free, and generally results in better garbage collection. In TypeScript / JavaScript it's generally a good policy to intentionally mark your structures as free, when you're done with them.
Seatbelts are a safety device, but they don't guarantee you can't get injured in a car accident. The issue is: Rust developers treat the seatbelt as accident prevention when it's not. Unsafe is the same as not putting the seatbelt on, but then claiming it's the same as being accident safe anyway, since someone else is wearing a seatbelt. If you doubt they think that, look up Lunduke, and read or watch his Rust coverage, they absolutely believe that Rust is some kind of magical language that makes the concept of bugs impossible.
I'll even settle this pointless argument if instead of memory safety, we just call it's reasonable memory assurance, which is more accurate.