cocci: use ALLOC_ARRAY
commit3f64699ffde6cd2152db2106505a2310601a207f
authorRené Scharfe <l.s.r@web.de>
Sat, 25 Feb 2017 10:30:03 +0000 (25 11:30 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2017 19:02:05 +0000 (27 11:02 -0800)
tree4642e6ba0aaaa6d6ba8c639a91d91187794fbb0f
parent3b9e3c2cede15057af3ff8076c45ad5f33829436
cocci: use ALLOC_ARRAY

Add a semantic patch for using ALLOC_ARRAY to allocate arrays and apply
the transformation on the current source tree.  The macro checks for
multiplication overflow and infers the element size automatically; the
result is shorter and safer code.

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