My function was just an example, clearly you would design a more functional robust piece of code for your purposes. If you don't like the solution however, you could realloc. I was just going along with what you already had.
Code:
// Just for the jist of it:
char **createArray(char *line, int *length)
{
char** array = NULL;
char* word = strtok(line, " ");
int i = 0;
while (word != NULL)
{
array = realloc(array, (i * sizeof(char*)) + sizeof(char*));
array[i] = malloc(sizeof(char) * strlen(word) + 1);
strcpy(array[i], word);
word = strtok(NULL," ");
i++;
}
*length = i;
return array;
}