Problem: Out of memory condition not always checked

Solution: Use the appropriate assertion macro.
This commit is contained in:
Thomas Braun
2017-03-27 22:57:40 +02:00
parent fe9f6b2837
commit 33e29bd383
7 changed files with 17 additions and 0 deletions

View File

@@ -212,6 +212,7 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
// Compile metadata.
zmq_assert (metadata == NULL);
metadata = new (std::nothrow) metadata_t (properties);
alloc_assert (metadata);
}
if (options.raw_notify) {
@@ -861,7 +862,10 @@ void zmq::stream_engine_t::mechanism_ready ()
zmq_assert (metadata == NULL);
if (!properties.empty ())
{
metadata = new (std::nothrow) metadata_t (properties);
alloc_assert (metadata);
}
#ifdef ZMQ_BUILD_DRAFT_API
socket->event_handshake_succeed(endpoint, 0);