From 3e244a0ccaef8303302a2c462f36b8bdf3634a46 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 9 Oct 2015 13:15:48 +0200 Subject: ui-shared: fix resource leak: free allocation from cgit_currenturl Coverity-id: 13927 Signed-off-by: Christian Hesse --- ui-shared.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index b739675..f6d38de 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -157,8 +157,11 @@ static void site_url(const char *page, const char *search, const char *sort, int if (always_root || page) html_attr(cgit_rooturl()); - else - html_attr(cgit_currenturl()); + else { + char *currenturl = cgit_currenturl(); + html_attr(currenturl); + free(currenturl); + } if (page) { htmlf("?p=%s", page); @@ -1020,19 +1023,21 @@ void cgit_print_pageheader(void) html("\n"); html("\n"); } else if (ctx.env.authenticated) { + char *currenturl = cgit_currenturl(); site_link(NULL, "index", NULL, hc("repolist"), NULL, NULL, 0, 1); if (ctx.cfg.root_readme) site_link("about", "about", NULL, hc("about"), NULL, NULL, 0, 1); html(""); html("
\n"); html("\n"); html("\n"); html("
"); + free(currenturl); } html("\n"); if (ctx.env.authenticated && ctx.qry.vpath) { -- cgit 1.4.1 a0d970f90ddc04f9be331e9c20e9'/>
Commit message (Expand)Author
2019-10-24Make serverFormat publicJune McEnroe
2019-10-24Rename some thingsJune McEnroe
2019-10-23Add ISUPPORT draft to STANDARDSJune McEnroe
2019-10-23Track own originJune McEnroe
2019-10-23Track channels and sync ISUPPORTJune McEnroe
2019-10-23Track nick changesJune McEnroe
2019-10-23Rename Command to MessageJune McEnroe
2019-10-23Synchronize state after client registrationJune McEnroe
2019-10-23Send to server if client has no needsJune McEnroe
2019-10-23Implement some amount of client connectionJune McEnroe
2019-10-23Set clients non-blockingJune McEnroe
2019-10-23Clean up state.c and factor out parsingJune McEnroe
2019-10-23Respond to pingsJune McEnroe
2019-10-23Add verbose flagJune McEnroe
2019-10-23Set NOSIGPIPE on server connectionJune McEnroe
2019-10-23Set an initial loop capJune McEnroe
2019-10-23Fix rest parsingJune McEnroe
2019-10-23Add dynamic poll listJune McEnroe
2019-10-23Don't assume commands have targets and handle ERRORJune McEnroe
2019-10-23Clean up state somewhatJune McEnroe
2019-10-23Actually send the buffer...June McEnroe
2019-10-23Add stateJune McEnroe