0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-26 06:41:03 +08:00

Problem: potential memory leak in test_connect_curve_fuzzer

Solution: properly initialize zmq_msg before receive
This commit is contained in:
Luca Boccassi 2020-05-09 12:31:36 +01:00
parent be77a8d932
commit abb315a6da

View File

@ -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);