kern/mips/arc/init: Add missing grub_strdup() failure check
If grub_strdup() fails, it returns NULL and passing NULL further down to the code can lead to segmentation fault or an undefined behavior. Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com> Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
9eebd67744
commit
f8c48cbedc
@ -403,6 +403,9 @@ grub_machine_get_bootlocation (char **device, char **path)
|
||||
if (!syspart)
|
||||
return;
|
||||
loaddev = grub_strdup (syspart);
|
||||
if (loaddev == NULL)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
partptr = get_part (loaddev);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user