diff options
author | Richard Maw | 2016-07-02 20:28:10 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2016-07-12 01:06:04 +0200 |
commit | ff9893ac8192579a00dd4c73ddff18ab232099a6 (patch) | |
tree | 2045ab39945aa86e6909b6ec2e5b0f6241cb8d80 | |
parent | d6b0332982234c73a26119e4ed60d442870b8078 (diff) | |
download | cgit-ff9893ac8192579a00dd4c73ddff18ab232099a6.tar.gz cgit-ff9893ac8192579a00dd4c73ddff18ab232099a6.tar.bz2 cgit-ff9893ac8192579a00dd4c73ddff18ab232099a6.zip |
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>
-rw-r--r-- | cgit.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -616,11 +616,11 @@ static int prepare_repo_cmd(void) | |||
616 | } | 616 | } |
617 | 617 | ||
618 | if (get_sha1(ctx.qry.head, sha1)) { | 618 | if (get_sha1(ctx.qry.head, sha1)) { |
619 | char *tmp = xstrdup(ctx.qry.head); | 619 | char *old_head = ctx.qry.head; |
620 | ctx.qry.head = ctx.repo->defbranch; | 620 | ctx.qry.head = xstrdup(ctx.repo->defbranch); |
621 | cgit_print_error_page(404, "Not found", | 621 | cgit_print_error_page(404, "Not found", |
622 | "Invalid branch: %s", tmp); | 622 | "Invalid branch: %s", old_head); |
623 | free(tmp); | 623 | free(old_head); |
624 | return 1; | 624 | return 1; |
625 | } | 625 | } |
626 | string_list_sort(&ctx.repo->submodules); | 626 | string_list_sort(&ctx.repo->submodules); |