1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 11:55:44 +03:00

exec-util: handle putenv() errors

Just paranoia, as putenv() can fail and we should catch it, like we
catch all other errors.

Follow-up for #10073
This commit is contained in:
Lennart Poettering 2018-09-25 12:02:26 +02:00
parent 9afd574039
commit ed689f7894

View File

@ -102,7 +102,8 @@ static int do_execute(
alarm(DIV_ROUND_UP(timeout, USEC_PER_SEC));
STRV_FOREACH(e, envp)
putenv(*e);
if (putenv(*e) < 0)
return log_error_errno(errno, "Failed to set environment variable: %m");
STRV_FOREACH(path, paths) {
_cleanup_free_ char *t = NULL;