freebsd-skq/contrib/ipfilter/iplang
cy 8ddae1aa96 calloc() and realloc() modernization.
This commit replaces calloc calls, which called calloc() as if it were
malloc() by allocating a multiple of objects as a sizeof multiplied by
the number of objects. The patch rectifies this by calling calloc() as
it was meant to be called.

This commit also replaces realloc() with reallocarray() in a similar
fashion as above. Instead of calculating the memory to reallocated
(changed) by multiplying sizeof by the number of objects, the sizeof
and number are passed as separate arguments to reallocarray(), letting
reallocarray() do the multiplication instead. Like the calloc()
adjustment above, this is approach is cleaner and more elegant than
than the previous code.

This has been tested on my production firewall and a laptop (also
running ipfilter).

Submitted by:	pfg
MFC after:	6 weeks
2017-03-16 04:40:07 +00:00
..
BNF Revert r288682 2015-10-05 03:26:51 +00:00
iplang_l.l calloc() and realloc() modernization. 2017-03-16 04:40:07 +00:00
iplang_y.y Revert r288682 2015-10-05 03:26:51 +00:00
iplang.h Revert r288682 2015-10-05 03:26:51 +00:00
iplang.tst Revert r288682 2015-10-05 03:26:51 +00:00
Makefile Revert r288682 2015-10-05 03:26:51 +00:00