stanfordnlp/GloVe

Typo mistake

Genie-Liu opened this issue · 1 comments

While I am looking into the source code, I find out there's a typo mistake which may cause null point exception if malloc fail.
The if statement should check W_updates2 instead of W_updates1. I have created a PR to fix it. #175

GloVe/src/glove.c

Lines 174 to 178 in afd83fb

}
real* W_updates2 = (real*)malloc(vector_size * sizeof(real));
if (NULL == W_updates1){
fclose(fin);
free(W_updates1);

Excellent, thanks!