When you use malloc, you create a space in memory that equals the size of the string, but is an empty space, you have only an address.
You have to copy the value on the string to the name[i] array.
An analogy is, you have a pot with water, you can create another pot, but you only will have water on it, if you transfer from one to another.
the creation of the pot is the malloc function and the transfer of the contents is the strcpy.
char str[6]; //create a empty space for 6 characters
char *name[1]; //create a pointer for a location where
//the array will be stored, does not
//allocate any space
str = "abcdef" //assign letters to character array
name[1]=(char *)malloc(strlen(str+1)); //name[1] = _ _ _ _ _ _ _
//allocate space char array with
//size equal to str array plus 1
strcpy(name[1],str); //name[1] = a b c d e f /0
//copy the letters from one char
//array to the other
character array has 6 characters plus a null character to indicate end of array