summaryrefslogtreecommitdiffstats
path: root/src/libsystemd
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-05-24 14:17:25 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-05-24 18:45:06 +0200
commit08a8fd6e8de82a664762e7dd16df47227f75e2be (patch)
treee9a787ea6e45628c5f1006fa0053f6a28ac5d7af /src/libsystemd
parentenv-file: use free_and_replace() (diff)
downloadsystemd-08a8fd6e8de82a664762e7dd16df47227f75e2be.tar.xz
systemd-08a8fd6e8de82a664762e7dd16df47227f75e2be.zip
sd-journal: propagate errors from ordered_hashmap_*()
Instead of masking them with -ENOMEM.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-journal/catalog.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libsystemd/sd-journal/catalog.c b/src/libsystemd/sd-journal/catalog.c
index 7f1dc0b4ed..06cf396b95 100644
--- a/src/libsystemd/sd-journal/catalog.c
+++ b/src/libsystemd/sd-journal/catalog.c
@@ -147,6 +147,7 @@ static int finish_item(
_cleanup_free_ CatalogItem *i = NULL;
_cleanup_free_ char *combined = NULL;
char *prev;
+ int r;
assert(h);
assert(payload);
@@ -169,8 +170,9 @@ static int finish_item(
if (!combined)
return log_oom();
- if (ordered_hashmap_update(h, i, combined) < 0)
- return log_oom();
+ r = ordered_hashmap_update(h, i, combined);
+ if (r < 0)
+ return r;
TAKE_PTR(combined);
free(prev);
@@ -180,8 +182,9 @@ static int finish_item(
if (!combined)
return log_oom();
- if (ordered_hashmap_put(h, i, combined) < 0)
- return log_oom();
+ r = ordered_hashmap_put(h, i, combined);
+ if (r < 0)
+ return r;
TAKE_PTR(i);
TAKE_PTR(combined);