summaryrefslogtreecommitdiffstats
path: root/src/resolve
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@vmware.com>2021-01-17 10:19:21 +0100
committerSusant Sahani <ssahani@vmware.com>2021-01-17 14:24:59 +0100
commit3004fcd0b8031a8b2d1bdaa60da906ef6b4e61de (patch)
treead21e10ad810eb78d099df7d8378977c9e3262b9 /src/resolve
parentresolved-bus: Use hashmap_ensure_put (diff)
downloadsystemd-3004fcd0b8031a8b2d1bdaa60da906ef6b4e61de.tar.xz
systemd-3004fcd0b8031a8b2d1bdaa60da906ef6b4e61de.zip
resolved-dns-packet: Use hashmap_ensure_put
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-dns-packet.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index ede499f486..704ac56a7c 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;