From 739d79c8e87dfaf9695f1f1f92e9ef45a2e706ff Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 10 Sep 2014 16:49:51 -0400 Subject: [PATCH 16/31] Check malloc() return. Covscan. Signed-off-by: Peter Jones --- src/efibootmgr/efibootmgr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c index d73c6aa..4d80f87 100644 --- a/src/efibootmgr/efibootmgr.c +++ b/src/efibootmgr/efibootmgr.c @@ -330,6 +330,8 @@ add_to_boot_order(uint16_t num) old_data = (uint16_t *)boot_order->data; new_data_size = boot_order->data_size + sizeof(uint16_t); new_data = malloc(new_data_size); + if (!new_data) + return -1; new_data[0] = num; memcpy(new_data+1, old_data, boot_order->data_size); -- 2.7.4