]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
output: JSON: fix possible leak in error-handling.
authorJeremy Sowden <jeremy@azazel.net>
Tue, 30 Nov 2021 10:55:57 +0000 (10:55 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 3 Jan 2022 16:50:14 +0000 (17:50 +0100)
commitbba33e0219b9a12aaf2bdd96315bd5c95026fa84
treed545ef177d2572842c23e200da8de0a93d06f71a
parent233e93b4742f340fb427046e874f28472a97dd21
output: JSON: fix possible leak in error-handling.

The `realloc` extending the buffer containing the JSON to allow us to
insert a final new-line may fail.  Therefore, we need to assign the
return-value to a temporary variable or we will not able to free the
existing buffer on error.

Use the correct type for `buflen`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
output/ulogd_output_JSON.c