Apart from bugs (as in #6152), this can happen if we ever make
our requirements for environment entries more stringent. As with
the rest of deserialization, we should just warn and continue.
}
int deserialize_environment(char ***environment, const char *line) {
- char *uce = NULL;
+ char *uce;
int r;
assert(line);
m->n_reloading++;
for (;;) {
- char line[LINE_MAX], *l;
- const char *val;
+ char line[LINE_MAX];
+ const char *val, *l;
if (!fgets(line, sizeof(line), f)) {
if (feof(f))
dual_timestamp_deserialize(val, &m->units_load_finish_timestamp);
else if (startswith(l, "env=")) {
r = deserialize_environment(&m->environment, l);
+ if (r == -ENOMEM)
+ goto finish;
if (r < 0)
- return r;
+ log_notice_errno(r, "Failed to parse environment entry: \"%s\": %m", l);
} else if ((val = startswith(l, "notify-fd="))) {
int fd;