commit 6918c6095815222b3887c6d86a27772826a9ac7a from: Tracey Emery date: Tue Apr 14 17:40:42 2020 UTC remove all asprintf from gw_output_site_link and fix error handling commit - e678920974066e4364fabf97bd4ab978237ff675 commit + 6918c6095815222b3887c6d86a27772826a9ac7a blob - 929d046c7ad23e7cee718a1c10c13bbb1b96e88c blob + f4118d21a05f1ce2274e9431d325494197e92754 --- gotweb/gotweb.c +++ gotweb/gotweb.c @@ -4446,9 +4446,9 @@ gw_output_site_link(struct gw_trans *gw_trans) kerr = khtml_puts(gw_trans->gw_html_req, " / "); if (kerr != KCGI_OK) goto done; - if (asprintf(&href_summary, "?path=%s&action=summary", - gw_trans->repo_name) == -1) - goto done; + + href_summary = khttp_urlpart(NULL, NULL, "gotweb", "path", + gw_trans->repo_name, "action", "summary", NULL), kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF, href_summary, KATTR__MAX); if (kerr != KCGI_OK) @@ -4470,6 +4470,8 @@ gw_output_site_link(struct gw_trans *gw_trans) goto done; done: free(href_summary); + if (error == NULL && kerr != KCGI_OK) + error = gw_kcgi_error(kerr); return error; }