about summary refs log tree commit diff stats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorChristian Hesse2015-10-09 13:15:50 +0200
committerJason A. Donenfeld2015-10-09 14:04:27 +0200
commitf77e2a8cfaf07b25ddedd57348a1d957b048bbf5 (patch)
tree3665e4bdb8f16401f43aeb309e9f8206ae2b2ded /ui-shared.c
parentcmd: fix resource leak: free allocation from cgit_currenturl and fmtalloc (diff)
downloadcgit-f77e2a8cfaf07b25ddedd57348a1d957b048bbf5.tar.gz
cgit-f77e2a8cfaf07b25ddedd57348a1d957b048bbf5.zip
ui-shared: return value of cgit_hosturl is not const
Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui-shared.c b/ui-shared.c index f6d38de..09c34fd 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -54,14 +54,14 @@ const char *cgit_httpscheme(void)
54 return "http://"; 54 return "http://";
55} 55}
56 56
57const char *cgit_hosturl(void) 57char *cgit_hosturl(void)
58{ 58{
59 if (ctx.env.http_host) 59 if (ctx.env.http_host)
60 return ctx.env.http_host; 60 return xstrdup(ctx.env.http_host);
61 if (!ctx.env.server_name) 61 if (!ctx.env.server_name)
62 return NULL; 62 return NULL;
63 if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80) 63 if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80)
64 return ctx.env.server_name; 64 return xstrdup(ctx.env.server_name);
65 return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); 65 return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
66} 66}
67 67