derkovecs: fix malloc for cases where less than 100 neighbours are required
diff --git a/w2v-server.pl b/w2v-server.pl
index 2c57554..2faeb94 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -604,6 +604,7 @@
void *getCollocators(void *args) {
knnpars *pars = args;
int N = pars->N;
+
int cc = pars->wl->wordi[0];
knn *nbs = NULL;
long window_layer_size = size * window * 2;
@@ -916,7 +917,7 @@
int para_threads = (no_similar_profiles? 0 : num_threads - syn_threads);
collocator *best;
- posix_memalign((void **) &best, 128, 10 * N * sizeof(collocator));
+ posix_memalign((void **) &best, 128, 10 * (N>=100? N : 100) * sizeof(collocator));
memset(best, 0, 10 * N * sizeof(collocator));
if(N>MAX_NEIGHBOURS) N=MAX_NEIGHBOURS;