From: teodor Date: Thu, 2 Oct 2008 14:20:21 +0000 (+0000) Subject: Fix memory leak in SFSIterate X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=tedtools.git;a=commitdiff_plain;h=3a5db7a2ae5ee98c443f5f2a669a37383ee2edf7 Fix memory leak in SFSIterate --- diff --git a/sfxstr.c b/sfxstr.c index 4a4e4da..e9bc84a 100644 --- a/sfxstr.c +++ b/sfxstr.c @@ -799,8 +799,13 @@ SFSIterate(SFSTree *info, SFSDataIO *out) { return 1; } - if ( s == NULL || s->node == NULL) + if ( s == NULL ) return 0; + if ( s->node == NULL ) { + info->stack = s->next; + tfree(s); + return SFSIterate(info, out); + } while ( s->level + s->node->nchar + 1 >= info->tlen ) { info->tlen *= 2;