0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Problem: memory leak in test_connect_null_fuzzer

Solution: initialize message before re-using it so that
receive doesn't fail and messages can be deallocated
This commit is contained in:
Luca Boccassi 2020-05-06 22:26:03 +01:00
parent 243503c29e
commit 5fd0711196

View File

@ -71,8 +71,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);