summaryrefslogtreecommitdiff
path: root/src/socket_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket_base.cpp')
-rw-r--r--src/socket_base.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index f5ba441..720e8cd 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -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);