about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2015-10-09 13:15:49 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2015-10-09 14:03:58 +0200
commit6f2e4400faebd829f905c824400f933fe07f5c30 (patch)
tree576519325e258cbf8ca78a3c22fa20689516cbe8
parentui-shared: fix resource leak: free allocation from cgit_currenturl (diff)
downloadcgit-pink-6f2e4400faebd829f905c824400f933fe07f5c30.tar.gz
cgit-pink-6f2e4400faebd829f905c824400f933fe07f5c30.zip
cmd: fix resource leak: free allocation from cgit_currenturl and fmtalloc
Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to '')
-rw-r--r--cmd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd.c b/cmd.c
index c991092..3093c62 100644
--- a/cmd.c
+++ b/cmd.c
@@ -41,9 +41,13 @@ static void about_fn(void)
 	if (ctx.repo) {
 		if (!ctx.qry.path &&
 		    ctx.qry.url[strlen(ctx.qry.url) - 1] != '/' &&
-		    ctx.env.path_info[strlen(ctx.env.path_info) - 1] != '/')
-			cgit_redirect(fmtalloc("%s/", cgit_currenturl()), true);
-		else
+		    ctx.env.path_info[strlen(ctx.env.path_info) - 1] != '/') {
+			char *currenturl = cgit_currenturl();
+			char *redirect = fmtalloc("%s/", currenturl);
+			cgit_redirect(redirect, true);
+			free(currenturl);
+			free(redirect);
+		} else
 			cgit_print_repo_readme(ctx.qry.path);
 	} else
 		cgit_print_site_readme();
>2018-09-27Add HJKL for moving glyphs to psfedJune McEnroe 2018-09-27Move psfed paste to edit modeJune McEnroe 2018-09-27Export PWDJune McEnroe 2018-09-27Add sans6x8 PSF2 fontJune McEnroe 2018-09-26Add copy paste to psfedJune McEnroe 2018-09-25Add r to psfed for invertJune McEnroe 2018-09-24Add psfed, a PSF2 font editorJune McEnroe 2018-09-21Add scheme -i to swap white and blackJune McEnroe 2018-09-21Map caps lock to escape on Linux consoleJune McEnroe 2018-09-19Fix README mandoc lintsJune McEnroe 2018-09-19Un-NOT trans.alpha values in pngoJune McEnroe 2018-09-18Refactor reads in pngo and clear palette between filesJune McEnroe 2018-09-17Add tRNS support to pngoJune McEnroe 2018-09-11Move gfx man pages to gfx/manJune McEnroe 2018-09-11Move bin man pages to bin/manJune McEnroe 2018-09-11Rewrite gfx.7 and render plaintext READMEJune McEnroe 2018-09-11Remove GAMES from BINSJune McEnroe 2018-09-11Rewrite bin.7 and render to plaintext READMEJune McEnroe 2018-09-11Add "blank" lines to man pagesJune McEnroe 2018-09-10Add mdoc syntax fileJune McEnroe 2018-09-08Fix Nm usage in multi-name man pagesJune McEnroe 2018-09-08Put real dates on man pagesJune McEnroe 2018-09-08Replace gfx README with REAMDE.7June McEnroe 2018-09-08Link gfx man pages in ~/.localJune McEnroe