diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2017-06-16 01:15:46 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-16 21:44:03 +0200 |
commit | 6a83d902073803c4141e02c53decf8c03e35da27 (patch) | |
tree | 209cf1639a325875240fce3e1f1cabbdb25878df /read-cache.c | |
parent | coccinelle: add a rule to make "type" code use FREE_AND_NULL() (diff) | |
download | git-6a83d902073803c4141e02c53decf8c03e35da27.tar.xz git-6a83d902073803c4141e02c53decf8c03e35da27.zip |
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>
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/read-cache.c b/read-cache.c index bc156a133e..66c413657e 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1888,8 +1888,7 @@ int discard_index(struct index_state *istate) free_name_hash(istate); cache_tree_free(&(istate->cache_tree)); istate->initialized = 0; - free(istate->cache); - istate->cache = NULL; + FREE_AND_NULL(istate->cache); istate->cache_alloc = 0; discard_split_index(istate); free_untracked_cache(istate->untracked); @@ -2603,8 +2602,7 @@ void *read_blob_data_from_index(const struct index_state *istate, void stat_validity_clear(struct stat_validity *sv) { - free(sv->sd); - sv->sd = NULL; + FREE_AND_NULL(sv->sd); } int stat_validity_check(struct stat_validity *sv, const char *path) |