free the variable

This commit is contained in:
c9s 2014-06-02 06:50:24 +08:00
parent 57b4fde126
commit 9271f0bf08
2 changed files with 2 additions and 0 deletions

View file

@ -503,6 +503,7 @@ node * r3_tree_insert_pathl_(node *tree, const char *path, int path_len, route *
int slug_cnt = slug_count(path, path_len, &err);
if (err) {
printf("Can not insert path '%s'. Error: %s\n", path, err);
free(err);
return NULL;
}

View file

@ -120,6 +120,7 @@ START_TEST (test_incomplete_slug_path)
ret_node = r3_tree_insert_path(n, "/post/{handle:\\d{3", NULL);
assert(!ret_node);
r3_tree_insert_path(n, "/post/{handle:\\d{3}", NULL);
r3_tree_insert_path(n, "/post/{handle:\\d{3}}/{", NULL);
r3_tree_insert_path(n, "/post/{handle:\\d{3}}/{a", NULL);