free slug object

This commit is contained in:
c9s 2014-08-12 18:02:48 +08:00
parent 21dcdd5807
commit bd22e7b35c

View file

@ -72,7 +72,6 @@ void r3_tree_free(node * tree) {
}
zfree(tree->edges);
zfree(tree->routes);
if (tree->pcre_pattern) {
pcre_free(tree->pcre_pattern);
}
@ -570,12 +569,15 @@ edge * r3_node_find_common_prefix(node *n, const char *path, int path_len, int *
break;
}
} else if (ret == -1) {
r3_slug_free(slug);
return NULL;
} else {
break;
}
} while(ret == 1);
// free the slug
r3_slug_free(slug);
}
*prefix_len = prefix;