diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-07-18 13:31:56 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-07-18 13:31:57 -0700 |
| commit | 7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf (patch) | |
| tree | 5f4b1b70e19b990092cecc676422042ad12e642a /builtin/fetch.c | |
| parent | Merge branch 'gc/submodule-use-super-prefix' (diff) | |
| parent | cocci: generalize "unused" rule to cover more than "strbuf" (diff) | |
| download | git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.tar.gz git-7f8d098b1b1ca1e5b91b17d05b51bc5b7a7ad6bf.zip | |
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 b019004c1b..fc5cecb483 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; } |
