It is obviously preferable for a function that fills a presupplied buffer not to need to allocate. (I don't know why it does.) But it is not disallowed by anything, if you want to be pedantic.