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
@ -264,8 +264,7 @@ static unsigned long write_no_reuse_object(struct sha1file *f, struct object_ent
|
||||
* make sure no cached delta data remains from a
|
||||
* previous attempt before a pack split occurred.
|
||||
*/
|
||||
free(entry->delta_data);
|
||||
entry->delta_data = NULL;
|
||||
FREE_AND_NULL(entry->delta_data);
|
||||
entry->z_delta_size = 0;
|
||||
} else if (entry->delta_data) {
|
||||
size = entry->delta_size;
|
||||
@ -1375,12 +1374,10 @@ static void cleanup_preferred_base(void)
|
||||
if (!pbase_tree_cache[i])
|
||||
continue;
|
||||
free(pbase_tree_cache[i]->tree_data);
|
||||
free(pbase_tree_cache[i]);
|
||||
pbase_tree_cache[i] = NULL;
|
||||
FREE_AND_NULL(pbase_tree_cache[i]);
|
||||
}
|
||||
|
||||
free(done_pbase_paths);
|
||||
done_pbase_paths = NULL;
|
||||
FREE_AND_NULL(done_pbase_paths);
|
||||
done_pbase_paths_num = done_pbase_paths_alloc = 0;
|
||||
}
|
||||
|
||||
@ -1970,8 +1967,7 @@ static unsigned long free_unpacked(struct unpacked *n)
|
||||
n->index = NULL;
|
||||
if (n->data) {
|
||||
freed_mem += n->entry->size;
|
||||
free(n->data);
|
||||
n->data = NULL;
|
||||
FREE_AND_NULL(n->data);
|
||||
}
|
||||
n->entry = NULL;
|
||||
n->depth = 0;
|
||||
|
||||
Reference in New Issue
Block a user