I didn't read freeing is not allowed, but I did not read freeing is. C functions that return pointers and do not specify they're internally freed, don't free them.