Zig detects memory leaks pretty well when you build it using -Doptimize=Debug.