If mySize is computed at runtime, that computation should most likely be checking for overflow. If it is a constant, declare it constexpr and get a compile-time warning for the overflow.
In any case, it's the multiplication that has a bug, not malloc (though I agree that the usage you mention is unfortunately common).