Fix memory leak in bind()

This commit is contained in:
Martin Hurton
2010-02-12 15:08:57 +01:00
parent cd7300fd4f
commit dc8f4b1b76
2 changed files with 4 additions and 3 deletions

View File

@@ -100,8 +100,10 @@ int zmq::socket_base_t::bind (const char *addr_)
choose_io_thread (options.affinity), this, options);
zmq_assert (listener);
int rc = listener->set_address (addr_type.c_str(), addr_args.c_str ());
if (rc != 0)
if (rc != 0) {
delete listener;
return -1;
}
send_plug (listener);
send_own (this, listener);