tree-wide: propagate the error we got from strv_extend_xyz() to the caller

It's a bit sloppy to return -ENOMEM rather than the actual error we
already returned in the first place (even though it's always going to be
ENOMEM)
This commit is contained in:
Lennart Poettering
2024-01-17 11:32:11 +01:00
parent 4212636763
commit 010cd1dc58
6 changed files with 20 additions and 15 deletions
+4 -2
View File
@@ -8,6 +8,7 @@
static int denylist_modules(const char *p, char ***denylist) {
_cleanup_strv_free_ char **k = NULL;
int r;
assert(p);
assert(denylist);
@@ -16,8 +17,9 @@ static int denylist_modules(const char *p, char ***denylist) {
if (!k)
return -ENOMEM;
if (strv_extend_strv(denylist, k, true) < 0)
return -ENOMEM;
r = strv_extend_strv(denylist, k, /* filter_duplicates= */ true);
if (r < 0)
return r;
return 0;
}