summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-09-17 20:13:47 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-09-17 20:13:47 +0200
commita95ae2d36ac4931265e9585e0b8e4eafec5887ae (patch)
tree7c08acf3e4afd3fac112e6dd1e2a200aca004335 /src
parentconf-parser: log errors in config_parse_many_files() and friends (diff)
downloadsystemd-a95ae2d36ac4931265e9585e0b8e4eafec5887ae.tar.xz
systemd-a95ae2d36ac4931265e9585e0b8e4eafec5887ae.zip
conf-parser: use hashmap_ensure_put() at one more place
Diffstat (limited to 'src')
-rw-r--r--src/shared/conf-parser.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index c9e5b49cd4..f862d0380b 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -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;