]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonMap.cc: assign directly, no need to set to NULL before
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 14 May 2018 21:49:29 +0000 (23:49 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 12 Jun 2018 21:14:15 +0000 (23:14 +0200)
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 <danny.al-gaaf@bisect.de>
src/mon/MonMap.cc

index 890289cf52e79f9b378047168bb35308166efc42..56d8926e28b441597f049142158a2b67db5fa4c3 100644 (file)
@@ -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);