1
1
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:
Lennart Poettering 2013-03-25 23:49:13 +01:00
parent 6a7d3d68bf
commit 608d41f355

View File

@ -169,8 +169,6 @@ static int create_disk(
} }
free(to); free(to);
to = NULL;
if (!nofail) if (!nofail)
to = strjoin(arg_dest, "/cryptsetup.target.requires/", n, NULL); to = strjoin(arg_dest, "/cryptsetup.target.requires/", n, NULL);
else else
@ -183,12 +181,13 @@ static int create_disk(
log_error("Failed to create symlink '%s' to '%s': %m", from, to); log_error("Failed to create symlink '%s' to '%s': %m", from, to);
return -errno; return -errno;
} }
free(to);
to = NULL;
} }
e = unit_name_escape(name); e = unit_name_escape(name);
if (!e)
return log_oom();
free(to);
to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL); to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL);
if (!to) if (!to)
return log_oom(); return log_oom();