diff options
| author | Heinrich Schuchardt <[email protected]> | 2017-10-26 19:25:45 +0200 |
|---|---|---|
| committer | Alexander Graf <[email protected]> | 2017-12-01 13:22:56 +0100 |
| commit | 753edb131a856267ca06598be0697163dbe58a49 (patch) | |
| tree | e9ee57fcb5ad20a8a16e179a8939f426f7a5f504 /lib | |
| parent | 843ce54c7470c58fa7251ad07abeed67b4fc56c4 (diff) | |
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 <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/efi_loader/efi_gop.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c index 411a8c92261..85b5391ed1d 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; |
