In case of an overflow "p" and "p->grub_devpath" will not be freed. Fix both issues. Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com> Reviewed-by: Alec Brown <alec.r.brown@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>