This was broken in
def36668a13459d9c0851e4d4da440a288f9a34f it looks like.
Passing uninitialized memory to resolve_addrs(), and needlessly
allocating a buffer.
Signed-off-by: Sage Weil <sage@newdream.net>
return 0;
} else { //maybe they passed us a DNS-resolvable name
char *hosts = NULL;
- char *old_addrs = new char[conf->mon_host.size() + 1];
- hosts = resolve_addrs(old_addrs);
- delete [] old_addrs;
+ hosts = resolve_addrs(conf->mon_host.c_str());
if (!hosts)
return -EINVAL;
bool success = parse_ip_port_vec(hosts, addrs);