mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
coccinelle: make use of the "type" FREE_AND_NULL() rule
Apply the result of the just-added coccinelle rule. This manually excludes a few occurrences, mostly things that resulted in many FREE_AND_NULL() on one line, that'll be manually fixed in a subsequent change. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
cf9f49ea48
commit
6a83d90207
6
alias.c
6
alias.c
@@ -47,8 +47,7 @@ int split_cmdline(char *cmdline, const char ***argv)
|
||||
src++;
|
||||
c = cmdline[src];
|
||||
if (!c) {
|
||||
free(*argv);
|
||||
*argv = NULL;
|
||||
FREE_AND_NULL(*argv);
|
||||
return -SPLIT_CMDLINE_BAD_ENDING;
|
||||
}
|
||||
}
|
||||
@@ -60,8 +59,7 @@ int split_cmdline(char *cmdline, const char ***argv)
|
||||
cmdline[dst] = 0;
|
||||
|
||||
if (quoted) {
|
||||
free(*argv);
|
||||
*argv = NULL;
|
||||
FREE_AND_NULL(*argv);
|
||||
return -SPLIT_CMDLINE_UNCLOSED_QUOTE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user