From: Susant Sahani Date: Sun, 17 Jan 2021 09:14:25 +0000 (+0100) Subject: resolved-bus: Use hashmap_ensure_put X-Git-Tag: v248-rc1~314^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71fb97c7c4c29374713cec7dec934672b7f91b32;p=thirdparty%2Fsystemd.git resolved-bus: Use hashmap_ensure_put --- diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 9a4789543a0..dd27c50b498 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -1943,11 +1943,7 @@ static int bus_method_register_service(sd_bus_message *message, void *userdata, if (r == 0) return 1; /* Polkit will call us back */ - r = hashmap_ensure_allocated(&m->dnssd_services, &string_hash_ops); - if (r < 0) - return r; - - r = hashmap_put(m->dnssd_services, service->name, service); + r = hashmap_ensure_put(&m->dnssd_services, &string_hash_ops, service->name, service); if (r < 0) return r;