Commit Diff


commit - 20f3465285652eb8a1277872699d2730d5ad4479
commit + 7a9bfbffc3cd8f01a9d19951b140a4e662b7d4b1
blob - 8659eb5dd93b13cf54efd9c894a859b58b472111
blob + 8e8c6ac6c83f332eb5ab0de5f780aa562b68bd94
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
@@ -1195,11 +1195,12 @@ gw_display_index(struct gw_trans *gw_trans, const stru
 	else
 		kerr = khttp_template(gw_trans->gw_req, gw_trans->gw_tmpl,
 		    gw_query_funcs[gw_trans->action].template);
-	if (kerr != KCGI_OK)
+	if (kerr != KCGI_OK) {
+		khtml_close(gw_trans->gw_html_req);
 		return gw_kcgi_error(kerr);
+	}
 
-	kerr = khtml_close(gw_trans->gw_html_req);
-	return gw_kcgi_error(kerr);
+	return gw_kcgi_error(khtml_close(gw_trans->gw_html_req));
 }
 
 static int