commit | f9ac54e665bbe4d2cc53d7b4ca463299ab5042a5 | [log] [tgz] |
---|---|---|
author | Marc Kupietz <kupietz@ids-mannheim.de> | Tue Nov 21 09:22:29 2017 +0100 |
committer | Marc Kupietz <kupietz@ids-mannheim.de> | Tue Nov 21 09:29:58 2017 +0100 |
tree | 555be866aaa6d982c769bfac9f86318303c5614c | |
parent | c469f3b6643520277e504a4662bab39ef967a23d [diff] [blame] |
w2v-server: handle out of dictionary words in a more robust way
diff --git a/w2v-server.pl b/w2v-server.pl index a956b22..c22aa4c 100755 --- a/w2v-server.pl +++ b/w2v-server.pl
@@ -527,7 +527,8 @@ if (b == -1) { fprintf(stderr, "Out of dictionary word!\n"); cn--; - break; + free(wl); + return NULL; } } wl->length=cn; @@ -625,7 +626,7 @@ cutoff=words; wl = getTargetWords(st1, search_backw); - if(wl->length < 1) + if(wl == NULL || wl->length < 1) goto end; old_words = cutoff;