summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/sd-resolve
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-01-21 11:38:29 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-01-21 11:38:33 +0100
commit48eae2e480ad0097ca432e16070e2658670bb06a (patch)
tree95af95b19f08bc7586c6a6389e415a0a351c0d12 /src/libsystemd/sd-resolve
parentsd-dhcp6-client: do not refer uninitialized variable (diff)
downloadsystemd-48eae2e480ad0097ca432e16070e2658670bb06a.tar.xz
systemd-48eae2e480ad0097ca432e16070e2658670bb06a.zip
test-resolve: check return value
Closes CID #1385310.
Diffstat (limited to 'src/libsystemd/sd-resolve')
-rw-r--r--src/libsystemd/sd-resolve/test-resolve.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c
index 752eb15228..b728dee9dd 100644
--- a/src/libsystemd/sd-resolve/test-resolve.c
+++ b/src/libsystemd/sd-resolve/test-resolve.c
@@ -89,7 +89,9 @@ int main(int argc, char *argv[]) {
assert_se(sd_resolve_default(&resolve) >= 0);
/* Test a floating resolver query */
- sd_resolve_getaddrinfo(resolve, NULL, "redhat.com", "http", NULL, getaddrinfo_handler, NULL);
+ r = sd_resolve_getaddrinfo(resolve, NULL, "redhat.com", "http", NULL, getaddrinfo_handler, NULL);
+ if (r < 0)
+ log_error_errno(r, "sd_resolve_getaddrinfo(): %m");
/* Make a name -> address query */
r = sd_resolve_getaddrinfo(resolve, &q1, argc >= 2 ? argv[1] : "www.heise.de", NULL, &hints, getaddrinfo_handler, NULL);