diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2006-04-24 02:28:12 +0000 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2006-04-24 02:28:12 +0000 |
commit | cf308c8cdbc3209f31d45f5ed28929f699d9837c (patch) | |
tree | 5d55fb305c117c7caf1001ac5e89e4c171c6cafa /treexpr.c | |
parent | aeb110d90df145ac99009c1a7b9e3077d6b457a6 (diff) |
Fixing some formatting issues, added a free_matches function to handle the
freeing of memory allocated in process_document, this function is now used in
the GrockHtml class to fix a memory leak.
Diffstat (limited to 'treexpr.c')
-rw-r--r-- | treexpr.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1143,3 +1143,21 @@ struct match *document_process( struct machine *m, xmlDocPtr doc ) { return node_recurse( m, doc->children->next, NULL ); } + +// free matches returned by document_process +void free_matches( struct match *z ) +{ + struct match *nextz; + struct regex_match *nextre; + + for( ; z != NULL; z = nextz ) + { + nextz = z->next; + for( ; z->re != NULL; z->re = nextre ) + { + nextre = z->re->next; + free( z->re ); + } + free( z ); + } +} |