summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2017-06-15 23:15:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-16 19:44:03 (GMT)
commit6a83d902073803c4141e02c53decf8c03e35da27 (patch)
tree209cf1639a325875240fce3e1f1cabbdb25878df /diff.c
parentcf9f49ea4817b36e93e64909a918a912cc32c28b (diff)
downloadgit-6a83d902073803c4141e02c53decf8c03e35da27.zip
git-6a83d902073803c4141e02c53decf8c03e35da27.tar.gz
git-6a83d902073803c4141e02c53decf8c03e35da27.tar.bz2
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 'diff.c')
-rw-r--r--diff.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/diff.c b/diff.c
index e35cf6c..3561adf 100644
--- a/diff.c
+++ b/diff.c
@@ -1218,8 +1218,7 @@ static void free_diff_words_data(struct emit_callback *ecbdata)
regfree(ecbdata->diff_words->word_regex);
free(ecbdata->diff_words->word_regex);
}
- free(ecbdata->diff_words);
- ecbdata->diff_words = NULL;
+ FREE_AND_NULL(ecbdata->diff_words);
}
}
@@ -2951,8 +2950,7 @@ void diff_free_filespec_blob(struct diff_filespec *s)
void diff_free_filespec_data(struct diff_filespec *s)
{
diff_free_filespec_blob(s);
- free(s->cnt_data);
- s->cnt_data = NULL;
+ FREE_AND_NULL(s->cnt_data);
}
static void prep_temp_blob(const char *path, struct diff_tempfile *temp,