summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2018-06-13 10:01:35 +0800
committerChristian Hesse <mail@eworm.de>2018-06-13 10:32:44 +0200
commitdc4651f15e34a9a1039039c87fd20cf10d7f11e9 (patch)
treee5a40a7f0e35fc2dcca8a11a8e367816307d6279
parent33414d7869aa55aaccd45cdb82268d454cb79863 (diff)
downloadcgit-dc4651f15e34a9a1039039c87fd20cf10d7f11e9.tar.gz
Use string list strdup_strings for mimetypes
There's no need to do this manually with the string list API will do it for us. Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r--cgit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index bd9cb3f..b37d3e0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -23,7 +23,7 @@ static void add_mimetype(const char *name, const char *value)
{
struct string_list_item *item;
- item = string_list_insert(&ctx.cfg.mimetypes, xstrdup(name));
+ item = string_list_insert(&ctx.cfg.mimetypes, name);
item->util = xstrdup(value);
}
@@ -419,7 +419,7 @@ static void prepare_context(void)
ctx.page.modified = time(NULL);
ctx.page.expires = ctx.page.modified;
ctx.page.etag = NULL;
- memset(&ctx.cfg.mimetypes, 0, sizeof(struct string_list));
+ string_list_init(&ctx.cfg.mimetypes, 1);
if (ctx.env.script_name)
ctx.cfg.script_name = xstrdup(ctx.env.script_name);
if (ctx.env.query_string)