conf-parser: use hashmap_ensure_put() at one more place

This commit is contained in:
Yu Watanabe
2024-09-18 03:13:47 +09:00
parent be8e4b1a87
commit a95ae2d36a
+1 -5
View File
@@ -465,10 +465,6 @@ int hashmap_put_stats_by_path(Hashmap **stats_by_path, const char *path, const s
assert(path);
assert(st);
r = hashmap_ensure_allocated(stats_by_path, &path_hash_ops_free_free);
if (r < 0)
return r;
st_copy = newdup(struct stat, st, 1);
if (!st_copy)
return -ENOMEM;
@@ -477,7 +473,7 @@ int hashmap_put_stats_by_path(Hashmap **stats_by_path, const char *path, const s
if (!path_copy)
return -ENOMEM;
r = hashmap_put(*stats_by_path, path_copy, st_copy);
r = hashmap_ensure_put(stats_by_path, &path_hash_ops_free_free, path_copy, st_copy);
if (r < 0)
return r;