diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-07-18 20:31:56 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-18 20:31:57 (GMT) |
commit | 7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf (patch) | |
tree | 5f4b1b70e19b990092cecc676422042ad12e642a /builtin/fetch.c | |
parent | 6d003858e5cb82a4ac1892fa6c02604b0aa27fba (diff) | |
parent | 06f5f8940c0335f2a5b0a7bbd086115f4659eaa8 (diff) | |
download | git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.zip git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.tar.gz git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.tar.bz2 |
Merge branch 'ab/cocci-unused'
Add Coccinelle rules to detect the pattern of initializing and then
finalizing a structure without using it in between at all, which
happens after code restructuring and the compilers fail to
recognize as an unused variable.
* ab/cocci-unused:
cocci: generalize "unused" rule to cover more than "strbuf"
cocci: add and apply a rule to find "unused" strbufs
cocci: have "coccicheck{,-pending}" depend on "coccicheck-test"
cocci: add a "coccicheck-test" target and test *.cocci rules
Makefile & .gitignore: ignore & clean "git.res", not "*.res"
Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r-- | builtin/fetch.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index b019004..fc5cecb 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1109,7 +1109,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, struct fetch_head *fetch_head) { int url_len, i, rc = 0; - struct strbuf note = STRBUF_INIT, err = STRBUF_INIT; + struct strbuf note = STRBUF_INIT; const char *what, *kind; struct ref *rm; char *url; @@ -1276,7 +1276,6 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, abort: strbuf_release(¬e); - strbuf_release(&err); free(url); return rc; } |