Merge pull request #1202 from pavel-pimenov/fix-pvs-studio

PVS Studio small fix
This commit is contained in:
Pieter Hintjens 2014-10-09 10:46:58 +02:00
commit 3aa5a9d409
2 changed files with 4 additions and 4 deletions

View File

@ -494,7 +494,7 @@ void zmq::session_base_t::start_connecting (bool wait_)
// Create the connecter object.
if (addr->protocol == "tcp") {
if (options.socks_proxy_address != "") {
if (!options.socks_proxy_address.empty()) {
address_t *proxy_address = new (std::nothrow)
address_t ("tcp", options.socks_proxy_address);
alloc_assert (proxy_address);

View File

@ -96,7 +96,7 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
int family = get_peer_ip_address (s, peer_address);
if (family == 0)
peer_address = "";
peer_address.clear();
#if defined ZMQ_HAVE_SO_PEERCRED
else
if (family == PF_UNIX) {
@ -781,7 +781,7 @@ void zmq::stream_engine_t::mechanism_ready ()
it = zap_properties.begin ();
while (it != zap_properties.end ()) {
properties.insert (properties_t::value_type (it->first, it->second));
it++;
++it;
}
// Add ZMTP properties.
@ -789,7 +789,7 @@ void zmq::stream_engine_t::mechanism_ready ()
it = zmtp_properties.begin ();
while (it != zmtp_properties.end ()) {
properties.insert (properties_t::value_type (it->first, it->second));
it++;
++it;
}
zmq_assert (metadata == NULL);