X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=lzindex%2Flztrie.c;h=7e4453deca1bc27061279a68f51d6d32773c0dea;hb=1c0ccf5923b31eceae88afc64f1b4727cd488643;hp=0a4c56b481f2a4e420beb1951881bfb46dd6e7e8;hpb=5d74bc076c9d15d607d183c16ff8468ea961a0f9;p=SXSI%2FTextCollection.git diff --git a/lzindex/lztrie.c b/lzindex/lztrie.c index 0a4c56b..7e4453d 100644 --- a/lzindex/lztrie.c +++ b/lzindex/lztrie.c @@ -59,6 +59,8 @@ lztrie buildLZTrie(byte *text, byte s, uint text_length) destroyTrie(T); LZT = createLZTrie(parent,letters,Node,n,text_length); + + free(Node); Node = 0; return LZT; } @@ -73,6 +75,7 @@ void destroyLZTrie(lztrie T) destroyNodemap(T->Node); destroyPosition(T->TPos); free(T->boost); + free(T); } @@ -132,7 +135,7 @@ lztrie loadLZTrie (FILE *f) i = 1; // shortcut for first child of root while (i != 2*T->n-1) { // shortcut for its closing parenthesis T->boost[T->letters[i-rank(T->pdata->bdata,i)]] = i; - // shortcut for leftrankLZTrie + // shortcut for leftrankLZTrie i = findclose(T->pdata,i)+1; }