mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-23 16:48:08 +02:00
Problem: test_security_gssapi does not close messages
Solution: do it to avoid leaks. Even though they are below 33 bytes so it's all allocated on the stack, the small message size might change in the future.
This commit is contained in:
@@ -74,6 +74,7 @@ get_monitor_event (void *monitor, int *value, char **address)
|
|||||||
uint16_t event = *(uint16_t *) (data);
|
uint16_t event = *(uint16_t *) (data);
|
||||||
if (value)
|
if (value)
|
||||||
*value = *(uint32_t *) (data + 2);
|
*value = *(uint32_t *) (data + 2);
|
||||||
|
zmq_msg_close (&msg);
|
||||||
|
|
||||||
// Second frame in message contains event address
|
// Second frame in message contains event address
|
||||||
zmq_msg_init (&msg);
|
zmq_msg_init (&msg);
|
||||||
@@ -88,6 +89,8 @@ get_monitor_event (void *monitor, int *value, char **address)
|
|||||||
memcpy (*address, data, size);
|
memcpy (*address, data, size);
|
||||||
*address [size] = 0;
|
*address [size] = 0;
|
||||||
}
|
}
|
||||||
|
zmq_msg_close (&msg);
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user