rsync: fix reallocarray() usage in blkhash_set()
authortb <tb@openbsd.org>
Fri, 27 Sep 2024 13:06:21 +0000 (13:06 +0000)
committertb <tb@openbsd.org>
Fri, 27 Sep 2024 13:06:21 +0000 (13:06 +0000)
commitcd54cfb88f9f5ff1a563936fccece38dbde1aaa1
tree0ff8ab12719a89c1ae76e7e645f1c48d2c69b57d
parent352e6c5d7c95cf0c08d3c38de0fb23cb51af1fce
rsync: fix reallocarray() usage in blkhash_set()

The well-named ERR() macro doesn't error out. Therefore an incorrect use
of reallocarray() is actually a leak that is easily overlooked. Do it the
right way by assigning to a temporary variable and preserve behavior by
freeing and NULL-ing.

ok claudio
usr.bin/rsync/blocks.c