Debug swcsa
[SXSI/TextCollection.git] / lzindex / lztrie.c
index 0a4c56b..2ac090a 100644 (file)
@@ -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;
     }
 
@@ -171,7 +174,7 @@ trieNode parentLZTrie (lztrie T, trieNode i)
  { 
     if (i == ROOT) return NULLT; // parent of root
     if (T->boost[T->letters[i-rank(T->pdata->bdata,i)]] == i) return ROOT;
-    return enclose (T->pdata,i);
+    return _enclose (T->pdata,i);
  }
 
        // subtree size