Commit Diff


commit - 38b240fba2a62bea4033e8154634327a603107ca
commit + dad0fde4b4035228eb341a31bc846d30750f58e0
blob - c92ce37fc45ee9dd84fe189d6ac34bed0aa9708e
blob + df1ea650aba2c180a345f281597a8c0c906721a1
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
@@ -2494,11 +2494,16 @@ gw_output_repo_tags(struct gw_trans *gw_trans, struct 
 			kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
 			    KATTR_ID, "tags_name", KATTR__MAX);
 			if (kerr != KCGI_OK)
+				goto done;
+			if (asprintf(&href_tag, "?path=%s&action=tag&commit=%s",
+			    gw_trans->repo_name, id_str) == -1) {
+				error = got_error_from_errno("asprintf");
 				goto done;
+			}
 			kerr = khtml_puts(gw_trans->gw_html_req, tag_commit);
 			if (kerr != KCGI_OK)
 				goto done;
-			kerr = khtml_closeelem(gw_trans->gw_html_req, 2);
+			kerr = khtml_closeelem(gw_trans->gw_html_req, 3);
 			if (kerr != KCGI_OK)
 				goto done;
 
@@ -2511,11 +2516,6 @@ gw_output_repo_tags(struct gw_trans *gw_trans, struct 
 			if (kerr != KCGI_OK)
 				goto done;
 
-			if (asprintf(&href_tag, "?path=%s&action=tag&commit=%s",
-			    gw_trans->repo_name, id_str) == -1) {
-				error = got_error_from_errno("asprintf");
-				goto done;
-			}
 			kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
 			    KATTR_HREF, href_tag, KATTR__MAX);
 			if (kerr != KCGI_OK)