coccinelle: polish FREE_AND_NULL rules
commit76d8d45ffbc2cee911a66bdc5b6280a00da1a555
authorRené Scharfe <l.s.r@web.de>
Sun, 25 Jun 2017 08:01:04 +0000 (25 10:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Jun 2017 17:46:16 +0000 (29 10:46 -0700)
treed29755913b4f57e9b56c5c50374d83e7a934af74
parent88ce3ef636b1385e861ec0e9e2155248b999b032
coccinelle: polish FREE_AND_NULL rules

There are two rules for using FREE_AND_NULL in free.cocci, one for
pointer types and one for expressions.  Both cause coccinelle to remove
empty lines and even newline characters between replacements for some
reason; consecutive "free(x);/x=NULL;" sequences end up as multiple
FREE_AND_NULL calls on the same time.

Remove the type rule, as the expression rule already covers it, and
rearrange the lines of the latter to place the addition of FREE_AND_NULL
between the removals, which causes coccinelle to leave surrounding
whitespace untouched.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/coccinelle/free.cocci