Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Pass request strings on without copying them
Diffstat (limited to 'source/ui-blame.c')
| -rw-r--r-- | source/ui-blame.c | 11 |
1 file changed, 3 insertions, 8 deletions
diff --git a/source/ui-blame.c b/source/ui-blame.c index 48cbf8e..efa9470 100644 --- a/source/ui-blame.c +++ b/source/ui-blame.c @@ -24,7 +24,7 @@ enum blame_target { }; struct walk_tree_context { - char *rev; + const char *rev; int match_baselen; enum blame_target found; }; @@ -338,12 +338,9 @@ static void print_blame_page(const struct object_id *oid, const char *path, html("<pre><code>"); if (ctx.repo->source_filter) { - char *filter_arg = xstrdup(filename); - - cgit_open_filter(ctx.repo->source_filter, filter_arg); + cgit_open_filter(ctx.repo->source_filter, filename); html_raw(buf, size); cgit_close_filter(ctx.repo->source_filter); - free(filter_arg); } else { html_blob_txt(buf, size); } @@ -428,7 +425,7 @@ void cgit_print_blame(void) return; } - walk.rev = xstrdup(rev); + walk.rev = rev; walk.match_baselen = path_items.match ? basedir_len(path_items.match) : -1; read_tree(the_repository, repo_get_commit_tree(the_repository, commit), &paths, walk_tree, &walk); @@ -436,6 +433,4 @@ void cgit_print_blame(void) cgit_print_error_page(404, "Not Found", "Not found"); else if (walk.found == TARGET_FOLDER) cgit_print_error_page(404, "Not Found", "Blame is not available for a directory"); - - free(walk.rev); } |
