Actually, this should be a memcpy().

We already know the exact length we just allocated, and we plan to append
 our own null terminator to the end of the copy, so this makes more sense.