diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-01-21 11:38:29 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-01-21 11:38:33 +0100 |
commit | 48eae2e480ad0097ca432e16070e2658670bb06a (patch) | |
tree | 95af95b19f08bc7586c6a6389e415a0a351c0d12 /src/libsystemd | |
parent | sd-dhcp6-client: do not refer uninitialized variable (diff) | |
download | systemd-48eae2e480ad0097ca432e16070e2658670bb06a.tar.xz systemd-48eae2e480ad0097ca432e16070e2658670bb06a.zip |
test-resolve: check return value
Closes CID #1385310.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-resolve/test-resolve.c | 4 |
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); |