]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
install: use ordered_hashmap_ensure_put
authorSusant Sahani <ssahani@vmware.com>
Mon, 18 Jan 2021 10:23:38 +0000 (11:23 +0100)
committerSusant Sahani <ssahani@vmware.com>
Mon, 18 Jan 2021 20:12:32 +0000 (21:12 +0100)
src/shared/install.c

index 302497a965b1271f8c10434ab9a7ea1e4f89691c..e70fa4502265677f14c8f1e11a037daeb15b9764 100644 (file)
@@ -1041,10 +1041,6 @@ static int install_info_add(
                 return 0;
         }
 
-        r = ordered_hashmap_ensure_allocated(&c->will_process, &string_hash_ops);
-        if (r < 0)
-                return r;
-
         i = new(UnitFileInstallInfo, 1);
         if (!i)
                 return -ENOMEM;
@@ -1068,7 +1064,7 @@ static int install_info_add(
                 }
         }
 
-        r = ordered_hashmap_put(c->will_process, i->name, i);
+        r = ordered_hashmap_ensure_put(&c->will_process, &string_hash_ops, i->name, i);
         if (r < 0)
                 goto fail;