From: Danny Al-Gaaf Date: Mon, 14 May 2018 21:49:29 +0000 (+0200) Subject: mon/MonMap.cc: assign directly, no need to set to NULL before X-Git-Tag: v14.0.1~984^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48372e6287e926dd742019a65d9f4d7aa61858d0;p=ceph.git mon/MonMap.cc: assign directly, no need to set to NULL before 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 --- diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc index 890289cf52e7..56d8926e28b4 100644 --- a/src/mon/MonMap.cc +++ b/src/mon/MonMap.cc @@ -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);