From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 2/4] scan-tree: remove useless strdup()
Date: Thu, 8 Oct 2015 23:23:57 +0100 [thread overview]
Message-ID: <1444343039-32055-3-git-send-email-john@keeping.me.uk> (raw)
In-Reply-To: <1444343039-32055-1-git-send-email-john@keeping.me.uk>
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 at keeping.me.uk>
---
scan-tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
}
--
1.7.9.5
next prev parent reply other threads:[~2015-10-08 22:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-08 22:23 [PATCH 0/4] Initial Coverity fixes john
2015-10-08 22:23 ` [PATCH 1/4] cgit.c: remove useless null check john
2015-10-08 22:23 ` john [this message]
2015-10-08 22:23 ` [PATCH 3/4] ui-blob: " john
2015-10-08 22:23 ` [PATCH 4/4] ui-refs: " john
2015-10-09 8:54 ` [PATCH 0/4] Initial Coverity fixes Jason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444343039-32055-3-git-send-email-john@keeping.me.uk \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).