From abb315a6da4c2bcb695cdfe0373352b77d60cca3 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 9 May 2020 12:31:36 +0100 Subject: [PATCH] Problem: potential memory leak in test_connect_curve_fuzzer Solution: properly initialize zmq_msg before receive --- tests/test_connect_curve_fuzzer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_connect_curve_fuzzer.cpp b/tests/test_connect_curve_fuzzer.cpp index cc3f77fa..e0dbb386 100644 --- a/tests/test_connect_curve_fuzzer.cpp +++ b/tests/test_connect_curve_fuzzer.cpp @@ -91,8 +91,10 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) zmq_msg_t msg; zmq_msg_init (&msg); - while (-1 != zmq_msg_recv (&msg, client, ZMQ_DONTWAIT)) + while (-1 != zmq_msg_recv (&msg, client, ZMQ_DONTWAIT)) { zmq_msg_close (&msg); + zmq_msg_init (&msg); + } close (server_accept); close (server);