From: Susant Sahani Date: Mon, 18 Jan 2021 18:13:33 +0000 (+0100) Subject: core: execute - use hashmap_ensure_put X-Git-Tag: v248-rc1~306^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=630837065e7f22d125bdf8a7dbcce6d36b18febd;p=thirdparty%2Fsystemd.git core: execute - use hashmap_ensure_put --- diff --git a/src/core/execute.c b/src/core/execute.c index ee5f082783b..2ac9537e1b7 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -6059,15 +6059,11 @@ static int exec_runtime_add( /* tmp_dir, var_tmp_dir, netns_storage_socket fds are donated on success */ - r = hashmap_ensure_allocated(&m->exec_runtime_by_id, &string_hash_ops); - if (r < 0) - return r; - r = exec_runtime_allocate(&rt, id); if (r < 0) return r; - r = hashmap_put(m->exec_runtime_by_id, rt->id, rt); + r = hashmap_ensure_put(&m->exec_runtime_by_id, &string_hash_ops, rt->id, rt); if (r < 0) return r;