mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-31 01:47:15 +03:00
cryptsetup-generator: add a missing OOM check
This commit is contained in:
parent
6a7d3d68bf
commit
608d41f355
@ -169,8 +169,6 @@ static int create_disk(
|
||||
}
|
||||
|
||||
free(to);
|
||||
to = NULL;
|
||||
|
||||
if (!nofail)
|
||||
to = strjoin(arg_dest, "/cryptsetup.target.requires/", n, NULL);
|
||||
else
|
||||
@ -183,12 +181,13 @@ static int create_disk(
|
||||
log_error("Failed to create symlink '%s' to '%s': %m", from, to);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
free(to);
|
||||
to = NULL;
|
||||
}
|
||||
|
||||
e = unit_name_escape(name);
|
||||
if (!e)
|
||||
return log_oom();
|
||||
|
||||
free(to);
|
||||
to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL);
|
||||
if (!to)
|
||||
return log_oom();
|
||||
|
Loading…
x
Reference in New Issue
Block a user