From: Heinrich Schuchardt Date: Thu, 26 Oct 2017 17:25:45 +0000 (+0200) Subject: efi_loader: efi_gop: check calloc return value X-Git-Tag: v2018.01-rc2~58^2~39 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=753edb131a856267ca06598be0697163dbe58a49;p=oweals%2Fu-boot.git efi_loader: efi_gop: check calloc return value Calloc may return NULL. We have to check the return value. Fixes: be8d324191f efi_loader: Add GOP support Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c index 411a8c9226..85b5391ed1 100644 --- a/lib/efi_loader/efi_gop.c +++ b/lib/efi_loader/efi_gop.c @@ -173,6 +173,10 @@ int efi_gop_register(void) } gopobj = calloc(1, sizeof(*gopobj)); + if (!gopobj) { + printf("ERROR: Out of memory\n"); + return 1; + } /* Fill in object data */ gopobj->parent.protocols[0].guid = &efi_gop_guid;