From 88ce3ef636b1385e861ec0e9e2155248b999b032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 15 Jun 2017 23:15:49 +0000 Subject: *.[ch] refactoring: make use of the FREE_AND_NULL() macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace occurrences of `free(ptr); ptr = NULL` which weren't caught by the coccinelle rule. These fall into two categories: - free/NULL assignments one after the other which coccinelle all put on one line, which is functionally equivalent code, but very ugly. - manually spotted occurrences where the NULL assignment isn't right after the free() call. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- split-index.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'split-index.c') diff --git a/split-index.c b/split-index.c index 49bd197f71..20477c6a48 100644 --- a/split-index.c +++ b/split-index.c @@ -174,10 +174,9 @@ void merge_base_index(struct index_state *istate) ewah_free(si->delete_bitmap); ewah_free(si->replace_bitmap); - free(si->saved_cache); + FREE_AND_NULL(si->saved_cache); si->delete_bitmap = NULL; si->replace_bitmap = NULL; - si->saved_cache = NULL; si->saved_cache_nr = 0; } -- cgit v1.2.3