Here are two problems I found with your function. Use this as your input text:
So line one is blank and line two contains the character 'a'. There is no line 3. Here's what your code would do:
First it would malloc space for the first line.
Code:
lst->strings[i] = malloc(csize * sizeof(wchar_t));
Second, it would see the newline character '\n'.
Code:
while((c = fgetwc(fin)) != L'\n' && c != WEOF)
Third, instead of placing '\n' into your array, you place '\0'.
Code:
lst->strings[i][j] = L'\0';
This is your first error. You just set a pointer to NULL without freeing its contents! Call free on strings[0] would do nothing on a Linux machine and you would have a memory leak.
Afterwards, your code does the 'a' character correctly. But let's see what it does after that.
j is incremented.
Then you see a newline character '\n'.
Code:
while((c = fgetwc(fin)) != L'\n' && c != WEOF)
Instead of putting the '\n' into your array, you put '\0'. This is totally fine here.
Code:
lst->strings[i][j] = L'\0';
Then you increment i
Then you go to your outer while loop.
Here c still equals '\n' and not WEOF. This is what begins your second error.
Now you malloc space that you don't need.
Code:
lst->strings[i] = malloc(csize * sizeof(wchar_t));
c becomes WEOF
Code:
while((c = fgetwc(fin)) != L'\n' && c != WEOF)
Now you set a pointer to null that you haven't freed yet! This is another memory leak.
Code:
lst->strings[i][j] = L'\0';
From there, your program runs fine. I don't know how these memory leaks cause a segfault on a Windows machine though.