mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-28 07:58:14 +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:
parent
243503c29e
commit
5fd0711196
@ -71,8 +71,10 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
|
|||||||
|
|
||||||
zmq_msg_t msg;
|
zmq_msg_t msg;
|
||||||
zmq_msg_init (&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_close (&msg);
|
||||||
|
zmq_msg_init (&msg);
|
||||||
|
}
|
||||||
|
|
||||||
close (server_accept);
|
close (server_accept);
|
||||||
close (server);
|
close (server);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user