free old pattern

This commit is contained in:
c9s 2014-05-23 11:14:26 +08:00
parent 55d74bd133
commit c841de166c

View file

@ -71,9 +71,10 @@ node * r3_edge_branch(edge *e, int dl) {
e->child->data = NULL; e->child->data = NULL;
// truncate the original edge pattern // truncate the original edge pattern
char *op = e->pattern; char *oldpattern = e->pattern;
e->pattern = zstrndup(e->pattern, dl); e->pattern = zstrndup(e->pattern, dl);
e->pattern_len = dl; e->pattern_len = dl;
zfree(oldpattern);
return new_child; return new_child;
} }