This is still wrong. 'xcods' is declared as a pointer to an int pointer (int **). If you use it as a handle to a malloc'd array, the array must contain int pointers,
not ints (which you're allocating).
Code:
tmpstruc->xcods = (int**) malloc(sizeof(int *) * (tmpstruc->faces));
for(loopa = 0; loopa < tmpstruc->faces; loopa++)
tmpstruc->xcods[loopa] = (int*) malloc(sizeof(int) * (tmpstruc->type + 3));
The same can be achieved more nicely, avoiding such bugs:
Code:
tmpstruc->xcods = (int**) malloc(sizeof(tmpstruc->xcods[0]) * (tmpstruc->faces));
for(loopa = 0; loopa < tmpstruc->faces; loopa++)
tmpstruc->xcods[loopa] = (int*) malloc(sizeof(tmpstruc->xcods[loopa][0]) * (tmpstruc->type + 3));
Also, in C, you don't need to cast the return value of malloc(), and any void pointer.