]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: handle oom properly
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 9 Apr 2016 01:08:15 +0000 (21:08 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 9 Apr 2016 01:08:15 +0000 (21:08 -0400)
CID #1349699-1349700.

src/resolve/resolved-bus.c
src/resolve/resolved-dns-transaction.c

index 16cae8c1e599e1ac140fa77f2afcadffcf6aefc4..33f7c615576c94c0bd7b0675cd89f878bd826870 100644 (file)
@@ -424,8 +424,9 @@ static void bus_method_resolve_address_complete(DnsQuery *q) {
         if (added <= 0) {
                 _cleanup_free_ char *ip = NULL;
 
-                in_addr_to_string(q->request_family, &q->request_address, &ip);
-                r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "Address '%s' does not have any RR of requested type", strna(ip));
+                (void) in_addr_to_string(q->request_family, &q->request_address, &ip);
+                r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR,
+                                               "Address '%s' does not have any RR of requested type", strnull(ip));
                 goto finish;
         }
 
index a5129c201e09df4de6dcbea2b8ddb2af6b2c6274..081131ede0e63d83417423eb3501cc3945b0b404 100644 (file)
@@ -262,7 +262,7 @@ static void dns_transaction_tentative(DnsTransaction *t, DnsPacket *p) {
         if (manager_our_packet(t->scope->manager, p) != 0)
                 return;
 
-        in_addr_to_string(p->family, &p->sender, &pretty);
+        (void) in_addr_to_string(p->family, &p->sender, &pretty);
 
         log_debug("Transaction %" PRIu16 " for <%s> on scope %s on %s/%s got tentative packet from %s.",
                   t->id,
@@ -270,7 +270,7 @@ static void dns_transaction_tentative(DnsTransaction *t, DnsPacket *p) {
                   dns_protocol_to_string(t->scope->protocol),
                   t->scope->link ? t->scope->link->name : "*",
                   af_to_name_short(t->scope->family),
-                  pretty);
+                  strnull(pretty));
 
         /* RFC 4795, Section 4.1 says that the peer with the
          * lexicographically smaller IP address loses */