From 6f2e4400faebd829f905c824400f933fe07f5c30 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 9 Oct 2015 13:15:49 +0200 Subject: cmd: fix resource leak: free allocation from cgit_currenturl and fmtalloc Signed-off-by: Christian Hesse --- cmd.c | 10 +++++++--- 1 file 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(); -- cgit 1.4.1 4d5edcfdbc'>refs log tree commit diff
Commit message (Expand)Author
2013-01-26Default to awesome sessionJune McEnroe
2013-01-26Add git promptJune McEnroe
2013-01-26Actually port awesome config to 3.5June McEnroe
2013-01-26Make pretty zshrcJune McEnroe
2013-01-26Port awesome config to 3.5June McEnroe
2013-01-26Replace RVM with chrubyJune McEnroe