cmd: eficonfig: check initrd path allocation
After allocating memory for the initrd file path we need to check the
initrd buffer pointer is not NULL.
Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index 8234e60..0ba92c6 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -1419,7 +1419,7 @@
}
bo->initrd_info.current_path = calloc(1, EFICONFIG_FILE_PATH_BUF_SIZE);
- if (!bo->file_info.current_path) {
+ if (!bo->initrd_info.current_path) {
ret = EFI_OUT_OF_RESOURCES;
goto out;
}