I noticed that it is a common idiom in C to accept an un-malloced pointer as a second argument instead of returning a pointer. Example:
/*functi
1) As Samir pointed out the code is incorrect, pointer is passed by value, you need **
2) The function is essentially a constructor, so it makes sense for it to both allocate the memory and init the data structure. Clean C code is almost always object oriented like that with constructors and destructors.
3) Your function is void, but it should be returning int so that it can return errors. There will be at least 2, probably 3 possible error conditions: malloc can fail, type argument can be invalid and possibly value can be out of range.