Fix qry.head leak on error

This is run soon before exiting so it wasn't leaked for long.

Signed-off-by: Richard Maw <richard.maw@gmail.com>
这个提交包含在:
Richard Maw 2016-07-02 20:28:10 +01:00 提交者 Jason A. Donenfeld
父节点 d6b0332982
当前提交 ff9893ac81
共有 1 个文件被更改,包括 4 次插入4 次删除

8
cgit.c
查看文件

@ -616,11 +616,11 @@ static int prepare_repo_cmd(void)
}
if (get_sha1(ctx.qry.head, sha1)) {
char *tmp = xstrdup(ctx.qry.head);
ctx.qry.head = ctx.repo->defbranch;
char *old_head = ctx.qry.head;
ctx.qry.head = xstrdup(ctx.repo->defbranch);
cgit_print_error_page(404, "Not found",
"Invalid branch: %s", tmp);
free(tmp);
"Invalid branch: %s", old_head);
free(old_head);
return 1;
}
string_list_sort(&ctx.repo->submodules);