mtrie: Do not throw exception on allocation failure

This commit is contained in:
Martin Hurton 2012-07-02 06:11:29 +02:00
parent e471e5b401
commit 692648de96

View File

@ -72,8 +72,10 @@ bool zmq::mtrie_t::add_helper (unsigned char *prefix_, size_t size_,
// We are at the node corresponding to the prefix. We are done.
if (!size_) {
bool result = !pipes;
if (!pipes)
pipes = new pipes_t;
if (!pipes) {
pipes = new (std::nothrow) pipes_t;
alloc_assert (pipes);
}
pipes->insert (pipe_);
return result;
}