summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-04-19 13:58:57 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-19 10:10:41 -0400
commit5a8e21785907df7466fef5e1cb54ce3bf99e5362 (patch)
treeededa6977d560841ad290e0991795e58e491a5af /src
parent31885cd5e38ec9807a6a7ab32660cf8c2fcf48f7 (diff)
crypt-setup-generator: correctly check return of strdup
Diffstat (limited to 'src')
-rw-r--r--src/cryptsetup/cryptsetup-generator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index ac0ed58dae..b31329dc09 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -302,7 +302,7 @@ static int parse_proc_cmdline(char ***arg_proc_cmdline_disks, char **arg_proc_cm
} else if (startswith(word, "luks.key=")) {
*arg_proc_cmdline_keyfile = strdup(word + 9);
- if (! arg_proc_cmdline_keyfile)
+ if (!*arg_proc_cmdline_keyfile)
return log_oom();
} else if (startswith(word, "rd.luks.key=")) {
@@ -311,7 +311,7 @@ static int parse_proc_cmdline(char ***arg_proc_cmdline_disks, char **arg_proc_cm
if (*arg_proc_cmdline_keyfile)
free(*arg_proc_cmdline_keyfile);
*arg_proc_cmdline_keyfile = strdup(word + 12);
- if (!arg_proc_cmdline_keyfile)
+ if (!*arg_proc_cmdline_keyfile)
return log_oom();
}