diff options
Diffstat (limited to 'kexec/kexec.c')
-rw-r--r-- | kexec/kexec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c index f3928af..6575ada 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -1020,13 +1020,15 @@ char *get_command_line(void) /* check we retained the initrd */ static void check_reuse_initrd(void) { + char *str = NULL; char *line = get_command_line(); - if (strstr(line, "retain_initrd") == NULL) + str = strstr(line, "retain_initrd"); + free(line); + + if (str == NULL) die("unrecoverable error: current boot didn't " "retain the initrd for reuse.\n"); - - free(line); } char *concat_cmdline(const char *base, const char *append) |