summaryrefslogtreecommitdiff
path: root/src/cryptsetup
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptsetup')
-rw-r--r--src/cryptsetup/cryptsetup-generator.c8
-rw-r--r--src/cryptsetup/cryptsetup.c8
2 files changed, 7 insertions, 9 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index fb6b4d25c0..c6bc65aecf 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -303,8 +303,7 @@ static int parse_proc_cmdline(void) {
t = strv_append(arg_proc_cmdline_disks, word + 10);
if (!t) {
- log_error("Out of memory.");
- r = -ENOMEM;
+ r = log_oom();
goto finish;
}
strv_free(arg_proc_cmdline_disks);
@@ -317,8 +316,7 @@ static int parse_proc_cmdline(void) {
t = strv_append(arg_proc_cmdline_disks, word + 13);
if (!t) {
- log_error("Out of memory.");
- r = -ENOMEM;
+ r = log_oom();
goto finish;
}
strv_free(arg_proc_cmdline_disks);
@@ -380,7 +378,7 @@ int main(int argc, char *argv[]) {
device = strappend("UUID=", *i);
if (!name || !device) {
- log_error("Out of memory.");
+ log_oom();
r = EXIT_FAILURE;
free(name);
free(device);
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 9d4e77364d..cc30e50003 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -343,7 +343,7 @@ int main(int argc, char *argv[]) {
l = strcspn(opt_cipher, "-");
if (!(truncated_cipher = strndup(opt_cipher, l))) {
- log_error("Out of memory.");
+ log_oom();
goto finish;
}
@@ -365,7 +365,7 @@ int main(int argc, char *argv[]) {
char **p;
if (asprintf(&text, "Please enter passphrase for disk %s!", name) < 0) {
- log_error("Out of memory.");
+ log_oom();
goto finish;
}
@@ -383,7 +383,7 @@ int main(int argc, char *argv[]) {
assert(strv_length(passwords) == 1);
if (asprintf(&text, "Please enter passphrase for disk %s! (verification)", name) < 0) {
- log_error("Out of memory.");
+ log_oom();
goto finish;
}
@@ -416,7 +416,7 @@ int main(int argc, char *argv[]) {
/* Pad password if necessary */
if (!(c = new(char, opt_key_size))) {
- log_error("Out of memory.");
+ log_oom();
goto finish;
}