From: Susant Sahani Date: Sun, 17 Jan 2021 09:19:21 +0000 (+0100) Subject: resolved-dns-packet: Use hashmap_ensure_put X-Git-Tag: v248-rc1~314^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3004fcd0b8031a8b2d1bdaa60da906ef6b4e61de;p=thirdparty%2Fsystemd.git resolved-dns-packet: Use hashmap_ensure_put --- diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index ede499f4865..704ac56a7c0 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -557,11 +557,7 @@ int dns_packet_append_name( goto fail; } - r = hashmap_ensure_allocated(&p->names, &dns_name_hash_ops); - if (r < 0) - goto fail; - - r = hashmap_put(p->names, s, SIZE_TO_PTR(n)); + r = hashmap_ensure_put(&p->names, &dns_name_hash_ops, s, SIZE_TO_PTR(n)); if (r < 0) goto fail;