This is like saying your neighbors siding is off color while your own is falling off and the framing is rotting.
Both are problems with siding, one is far more serious than the other. I'm not a fan of Java, but cpp people being disingenuous is a pet peeve. "Modern" cpp still sucks, it just sucks less - it's not useful to pretend otherwise.
Our cloud service at Sococo, back in the day, their principle bug-tracing activity was Java null pointers. The second? leaks. Both problems with pointer management.
However you slice it, it takes discipline to get memory allocation right. No magic bullet.