Skip to content

Commit

Permalink
mon/MonMap.cc: assign directly, no need to set to NULL before
Browse files Browse the repository at this point in the history
Fix for:

[src/mon/MonMap.cc:367] -> [src/mon/MonMap.cc:368]: (style) Variable
 'hosts' is reassigned a value before the old one has been used.

Signed-off-by: Danny Al-Gaaf <[email protected]>
  • Loading branch information
dalgaaf committed Jun 12, 2018
1 parent 65d78fb commit 48372e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mon/MonMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ int MonMap::build_from_host_list(std::string hostlist, const std::string &prefix
}

// maybe they passed us a DNS-resolvable name
char *hosts = NULL;
hosts = resolve_addrs(hostlist.c_str());
char *hosts = resolve_addrs(hostlist.c_str());
if (!hosts)
return -EINVAL;
bool success = parse_ip_port_vec(hosts, addrs);
Expand Down

0 comments on commit 48372e6

Please sign in to comment.