Per report from Robert Gravsjö.
/* Array to search lexeme by exact match */
TheLexeme *wrds;
- int nwrds;
- int ntwrds;
+ int nwrds; /* current number of words */
+ int ntwrds; /* allocated array length */
/*
* Storage of substituted result, n-th element is for n-th expression
static TheLexeme *
addCompiledLexeme(TheLexeme *newwrds, int *nnw, int *tnm, TSLexeme *lexeme, LexemeInfo *src, uint16 tnvariant)
{
-
if (*nnw >= *tnm)
{
*tnm *= 2;
pfree(d->wrds[i].entries);
}
- pfree(d->wrds);
+ if (d->wrds)
+ pfree(d->wrds);
d->wrds = newwrds;
d->nwrds = nnw;
d->ntwrds = tnm;