How about using `memset(p, 0, sz)` here?