diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-16 04:47:03 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-16 04:47:03 +0200 |
commit | 4e0296a943e85316ecce0324248f9543887b8a9a (patch) | |
tree | 5a31f947817d8bed82c75aded6247cb97e606545 /src/resolve/resolved-dns-packet.c | |
parent | test-compress-benchmark: silence warnings (diff) | |
download | systemd-4e0296a943e85316ecce0324248f9543887b8a9a.tar.xz systemd-4e0296a943e85316ecce0324248f9543887b8a9a.zip |
resolve: avoid use of uninitalized variable
Diffstat (limited to '')
-rw-r--r-- | src/resolve/resolved-dns-packet.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index 2a666924b0..a503b01506 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -594,7 +594,7 @@ fail: } int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) { - _cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL; + _cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr; size_t saved_rindex, offset; uint16_t rdlength; const void *d; @@ -603,11 +603,11 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) { assert(p); assert(ret); - saved_rindex = p->rindex; - rr = dns_resource_record_new(); if (!rr) - goto fail; + return -ENOMEM; + + saved_rindex = p->rindex; r = dns_packet_read_key(p, &rr->key, NULL); if (r < 0) |