sd-journal: propagate errors from ordered_hashmap_*()
Instead of masking them with -ENOMEM.
This commit is contained in:
@@ -147,6 +147,7 @@ static int finish_item(
|
|||||||
_cleanup_free_ CatalogItem *i = NULL;
|
_cleanup_free_ CatalogItem *i = NULL;
|
||||||
_cleanup_free_ char *combined = NULL;
|
_cleanup_free_ char *combined = NULL;
|
||||||
char *prev;
|
char *prev;
|
||||||
|
int r;
|
||||||
|
|
||||||
assert(h);
|
assert(h);
|
||||||
assert(payload);
|
assert(payload);
|
||||||
@@ -169,8 +170,9 @@ static int finish_item(
|
|||||||
if (!combined)
|
if (!combined)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
if (ordered_hashmap_update(h, i, combined) < 0)
|
r = ordered_hashmap_update(h, i, combined);
|
||||||
return log_oom();
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
TAKE_PTR(combined);
|
TAKE_PTR(combined);
|
||||||
free(prev);
|
free(prev);
|
||||||
@@ -180,8 +182,9 @@ static int finish_item(
|
|||||||
if (!combined)
|
if (!combined)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
if (ordered_hashmap_put(h, i, combined) < 0)
|
r = ordered_hashmap_put(h, i, combined);
|
||||||
return log_oom();
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
TAKE_PTR(i);
|
TAKE_PTR(i);
|
||||||
TAKE_PTR(combined);
|
TAKE_PTR(combined);
|
||||||
|
|||||||
Reference in New Issue
Block a user