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:
Ævar Arnfjörð Bjarmason
2017-06-15 23:15:46 +00:00
committed by Junio C Hamano
parent cf9f49ea48
commit 6a83d90207
37 changed files with 71 additions and 142 deletions

3
tree.c
View File

@ -226,8 +226,7 @@ int parse_tree_gently(struct tree *item, int quiet_on_missing)
void free_tree_buffer(struct tree *tree)
{
free(tree->buffer);
tree->buffer = NULL;
FREE_AND_NULL(tree->buffer);
tree->size = 0;
tree->object.parsed = 0;
}