1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-30 23:21:08 +03:00

crypt-setup-generator: correctly check return of strdup

This commit is contained in:
Lukas Nykryn 2013-04-19 13:58:57 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 31885cd5e3
commit 5a8e217859

View File

@ -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();
}