about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2015-10-09 13:15:50 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2015-10-09 14:04:27 +0200
commitf77e2a8cfaf07b25ddedd57348a1d957b048bbf5 (patch)
tree3665e4bdb8f16401f43aeb309e9f8206ae2b2ded
parentcmd: fix resource leak: free allocation from cgit_currenturl and fmtalloc (diff)
downloadcgit-pink-f77e2a8cfaf07b25ddedd57348a1d957b048bbf5.tar.gz
cgit-pink-f77e2a8cfaf07b25ddedd57348a1d957b048bbf5.zip
ui-shared: return value of cgit_hosturl is not const
Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to '')
-rw-r--r--ui-shared.c6
-rw-r--r--ui-shared.h2
2 files changed, 4 insertions, 4 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)
 		return "http://";
 }
 
-const char *cgit_hosturl(void)
+char *cgit_hosturl(void)
 {
 	if (ctx.env.http_host)
-		return ctx.env.http_host;
+		return xstrdup(ctx.env.http_host);
 	if (!ctx.env.server_name)
 		return NULL;
 	if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80)
-		return ctx.env.server_name;
+		return xstrdup(ctx.env.server_name);
 	return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
 }
 
diff --git a/ui-shared.h b/ui-shared.h
index 4121416..474e0c5 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -2,7 +2,7 @@
 #define UI_SHARED_H
 
 extern const char *cgit_httpscheme();
-extern const char *cgit_hosturl();
+extern char *cgit_hosturl();
 extern const char *cgit_rooturl();
 extern char *cgit_currenturl();
 extern const char *cgit_loginurl();
/commit/README?id=72f8991c8a5aef2d37192429a0365dee838d12ed&follow=1'>New mailing list.Jason A. Donenfeld 2013-04-30ui-snapshot: do not access $HOMEJason A. Donenfeld 2013-04-27t0001: validate Git -rcN version numbers correctlyJohn Keeping 2013-04-27git: update to 1.8.2.2John Keeping 2013-04-17scan-tree: fix regression in section-from-path=-1John Keeping 2013-04-15t0001: ignore ".dirty" suffix on Git versionJohn Keeping 2013-04-15tests: set TEST_OUTPUT_DIRECTORY to the CGit test directoryJohn Keeping 2013-04-15t0109: test more URLsJohn Keeping 2013-04-10cgitrc.5.txt: Specify when scan-path must be defined before.Jason A. Donenfeld 2013-04-10ui-snapshot.c: Prepend "V" when guessing ref namesLukas Fleischer 2013-04-10t0107: Skip ZIP tests if unzip(1) isn't availableLukas Fleischer 2013-04-10tests/: Do not use `sed -i`Lukas Fleischer 2013-04-10Add branch-sort and repo.branch-sort options.Jason A. Donenfeld 2013-04-10t0109: chain operations with &&John Keeping 2013-04-10cgit.c: Do not restore unset environment variablesLukas Fleischer 2013-04-09t0107: Use `tar -z` for gzip'ed archivesLukas Fleischer