mirror of
https://github.com/zeromq/libzmq.git
synced 2025-02-23 15:14:40 +01:00
Problem: inconsistent behaviour of zmq_poller_new in case of memory exhaustion
Solution: return NULL and set errno to ENOMEM
This commit is contained in:
parent
2cd147e5ff
commit
213254cca5
@ -1167,7 +1167,9 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||
void *zmq_poller_new (void)
|
||||
{
|
||||
zmq::socket_poller_t *poller = new (std::nothrow) zmq::socket_poller_t;
|
||||
alloc_assert (poller);
|
||||
if (!poller) {
|
||||
errno = ENOMEM;
|
||||
}
|
||||
return poller;
|
||||
}
|
||||
|
||||
@ -1295,7 +1297,6 @@ int zmq_poller_remove_fd (void *poller_, int fd_)
|
||||
return ((zmq::socket_poller_t *) poller_)->remove_fd (fd_);
|
||||
}
|
||||
|
||||
|
||||
int zmq_poller_wait (void *poller_, zmq_poller_event_t *event_, long timeout_)
|
||||
{
|
||||
if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user