From: John Keeping Date: Thu, 8 Oct 2015 22:23:57 +0000 (+0100) Subject: scan-tree: remove useless strdup() X-Git-Tag: v0.12~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=687cdf69689edcaff8e9035af93baf1a9e71cf32;p=cgit scan-tree: remove useless strdup() parse_configfile() takes a "const char *" and doesn't hold any references to it after it returns; there is no reason to pass it a duplicate. Coverity-id: 13941 Signed-off-by: John Keeping --- diff --git a/scan-tree.c b/scan-tree.c index 8e3cf52..b5a10ff 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -174,7 +174,7 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn) strbuf_addstr(path, "cgitrc"); if (!stat(path->buf, &st)) - parse_configfile(xstrdup(path->buf), &repo_config); + parse_configfile(path->buf, &repo_config); strbuf_release(&rel); }