aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_resolver.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-04 08:43:55 +0100
committerMax Kellermann <max@duempel.org>2013-12-04 08:43:55 +0100
commite1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee (patch)
treefac9794063e63a6e3e870a6455f13df54ef146fe /test/run_resolver.cxx
parentd694150372408cd80b89a2e27a88f91b5f856b67 (diff)
downloadmpd-e1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee.tar.gz
mpd-e1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee.tar.xz
mpd-e1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee.zip
system/Resolver: sockaddr_to_string() returns std::string()
No GLib memory allocation.
Diffstat (limited to '')
-rw-r--r--test/run_resolver.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/test/run_resolver.cxx b/test/run_resolver.cxx
index 7da2fd5b2..65c55b4df 100644
--- a/test/run_resolver.cxx
+++ b/test/run_resolver.cxx
@@ -51,16 +51,8 @@ int main(int argc, char **argv)
}
for (const struct addrinfo *i = ai; i != NULL; i = i->ai_next) {
- char *p = sockaddr_to_string(i->ai_addr, i->ai_addrlen,
- error);
- if (p == NULL) {
- freeaddrinfo(ai);
- LogError(error);
- return EXIT_FAILURE;
- }
-
- g_print("%s\n", p);
- g_free(p);
+ const auto s = sockaddr_to_string(i->ai_addr, i->ai_addrlen);
+ g_print("%s\n", s.c_str());
}
freeaddrinfo(ai);