Fixed small problem. Original code does:

 char** ... = malloc(n * sizeof(char**));

It should have been sizeof(char*). Not a big issue, since
size of all pointers would be the same.