From: Vladimir 'phcoder' Serbinenko Date: Thu, 23 Jun 2011 18:38:19 +0000 (+0200) Subject: * grub-core/loader/i386/xnu.c (grub_cpu_xnu_fill_devprop): Don't attempt X-Git-Tag: 2.00~1212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbc626665f458d60cc3d19e1e8eedb68638cb4dc;p=thirdparty%2Fgrub.git * grub-core/loader/i386/xnu.c (grub_cpu_xnu_fill_devprop): Don't attempt to continue if allocation is failed. Reported by: David Volgyes . --- diff --git a/ChangeLog b/ChangeLog index ad72c8da2..66c55d101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-06-23 Vladimir Serbinenko + + * grub-core/loader/i386/xnu.c (grub_cpu_xnu_fill_devprop): Don't attempt + to continue if allocation is failed. + + Reported by: David Volgyes . + 2011-06-23 David Volgyes * grub-core/bus/usb/ohci.c (grub_ohci_pci_iter): Avoid NULL-pointer diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c index b877b0ea5..6128ec384 100644 --- a/grub-core/loader/i386/xnu.c +++ b/grub-core/loader/i386/xnu.c @@ -452,11 +452,11 @@ grub_cpu_xnu_fill_devprop (void) } devprop = grub_xnu_create_value (&(efikey->first_child), "device-properties"); - if (devprop) - { - devprop->data = grub_malloc (total_length); - devprop->datasize = total_length; - } + if (!devprop) + return grub_errno; + + devprop->data = grub_malloc (total_length); + devprop->datasize = total_length; ptr = devprop->data; head = ptr;