remove unnecessary NULL checks; if header is NULL we don't get here
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 218a347..8cc8ff9 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -408,8 +408,7 @@ gw_diff(struct gw_trans *gw_trans)
if (kerr != KCGI_OK)
error = gw_kcgi_error(kerr);
done:
- if (header)
- got_ref_list_free(&header->refs);
+ got_ref_list_free(&header->refs);
gw_free_headers(header);
free(diff_html_disp);
free(diff_html);
@@ -600,8 +599,7 @@ gw_commits(struct gw_trans *gw_trans)
if (kerr != KCGI_OK)
error = gw_kcgi_error(kerr);
- if (header)
- got_ref_list_free(&header->refs);
+ got_ref_list_free(&header->refs);
gw_free_headers(header);
TAILQ_FOREACH(n_header, &gw_trans->gw_headers, entry)
gw_free_headers(n_header);
@@ -664,8 +662,7 @@ gw_briefs(struct gw_trans *gw_trans)
if (kerr != KCGI_OK)
error = gw_kcgi_error(kerr);
- if (header)
- got_ref_list_free(&header->refs);
+ got_ref_list_free(&header->refs);
gw_free_headers(header);
TAILQ_FOREACH(n_header, &gw_trans->gw_headers, entry)
gw_free_headers(n_header);
@@ -823,8 +820,7 @@ gw_tree(struct gw_trans *gw_trans)
kerr = khttp_puts(gw_trans->gw_req, tree);
if (kerr != KCGI_OK)
error = gw_kcgi_error(kerr);
- if (header)
- got_ref_list_free(&header->refs);
+ got_ref_list_free(&header->refs);
gw_free_headers(header);
free(tree_html_disp);
free(tree_html);