From b7c4829c2b8f3b864f7f66cb21872943845523ad Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 18 May 2014 08:04:24 +0800 Subject: [PATCH] Fix node pattern re-assignment --- src/node.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node.c b/src/node.c index a4f6412..ad78171 100644 --- a/src/node.c +++ b/src/node.c @@ -420,9 +420,12 @@ node * r3_tree_insert_pathn(node *tree, char *route, int route_len, void * route // printf("edge right: %s\n", e2->pattern); r3_tree_append_edge(e->child, e2); + + char *op = e->pattern; // truncate the original edge pattern - // e->pattern = strndup(e->pattern, dl); + e->pattern = strndup(e->pattern, dl); e->pattern_len = dl; + free(op); // move n->edges to c1 c2->endpoint++;