coccinelle: add a rule to make "expression" code use FREE_AND_NULL()

A follow-up to the existing "type" rule added in an earlier
change. This catches some occurrences that are missed by the previous
rule.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2017-06-15 23:15:47 +00:00 коммит произвёл Junio C Hamano
Родитель 6a83d90207
Коммит 1b83d1251e
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -17,3 +17,10 @@ T *ptr;
- free(ptr);
- ptr = NULL;
+ FREE_AND_NULL(ptr);
@@
expression E;
@@
- free(E);
- E = NULL;
+ FREE_AND_NULL(E);