My point is not that use-after-free or other resource allocation problems do not exist. The point is that in vanilla C any solution one might come up with is too fragile. Reasonable patterns require a very, very steady hand to work (which means it doesn't scale).
C++ came up with a few consistent language-level RAII-based solutions to the problem. Rust came up with a single big consistent language-level approach. Both Rust and C++ insist on using it in all cases.
What Zig does, and which I like, is that it refocuses the language on tools that make it easy to codify the right thing without making it a cornerstone of the language itself. But without introducing the kind of complexity C++ (and Rust to an extent) is famous for.
At its core, it takes the Modula-2 type system from 1978 and makes is appealing to C devs, with sprinkles of compile time programming on top, not as powerful as Lisp macros.
Much better than raw C, but still it leaves things to be desired in the context of safe systems programming.