]> granicus.if.org Git - cgit/commitdiff
scan-tree: remove useless strdup()
authorJohn Keeping <john@keeping.me.uk>
Thu, 8 Oct 2015 22:23:57 +0000 (23:23 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 9 Oct 2015 08:54:30 +0000 (10:54 +0200)
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 <john@keeping.me.uk>
scan-tree.c

index 8e3cf52b348f2df6436246103e7c2280926c2c99..b5a10ffa5cf491c6ec811413740db20ad0dfb583 100644 (file)
@@ -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);
 }