[PATCH 1/3] ui-repolist: fix memory leak

Christian Hesse list at eworm.de
Mon Oct 10 20:36:00 CEST 2016


From: Christian Hesse <mail at eworm.de>

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-repolist.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ui-repolist.c b/ui-repolist.c
index 1d9a7f7..7158bf7 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -343,13 +343,15 @@ void cgit_print_repolist(void)
 				html_txt(ctx.repo->owner);
 				cgit_close_filter(ctx.repo->owner_filter);
 			} else {
+				char *currenturl = cgit_currenturl();
 				html("<a href='");
-				html_attr(cgit_currenturl());
+				html_attr(currenturl);
 				html("?q=");
 				html_url_arg(ctx.repo->owner);
 				html("'>");
 				html_txt(ctx.repo->owner);
 				html("</a>");
+				free(currenturl);
 			}
 			html("</td><td>");
 		}
-- 
2.10.0



More information about the CGit mailing list