diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2017-06-16 01:15:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-16 21:44:07 +0200 |
commit | e140f7afddcdce2bae062ea1578eac38c744e3a5 (patch) | |
tree | df54a2725f418f14c64d7c0e97cb189cdbecd8c5 /ll-merge.c | |
parent | coccinelle: add a rule to make "expression" code use FREE_AND_NULL() (diff) | |
download | git-e140f7afddcdce2bae062ea1578eac38c744e3a5.tar.xz git-e140f7afddcdce2bae062ea1578eac38c744e3a5.zip |
coccinelle: make use of the "expression" FREE_AND_NULL() rule
A follow-up to the existing "expression" rule added in an earlier
change. 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 'll-merge.c')
-rw-r--r-- | ll-merge.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ll-merge.c b/ll-merge.c index ac0d4a5d78..91ff519cef 100644 --- a/ll-merge.c +++ b/ll-merge.c @@ -209,8 +209,7 @@ static int ll_ext_merge(const struct ll_merge_driver *fn, result->size = st.st_size; result->ptr = xmallocz(result->size); if (read_in_full(fd, result->ptr, result->size) != result->size) { - free(result->ptr); - result->ptr = NULL; + FREE_AND_NULL(result->ptr); result->size = 0; } close_bad: |