From 34e5043496d3b1d84fd434fa65c830c8eafd8dcd Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 18 Oct 2017 17:33:34 -0400 Subject: MokManager: Fix a conditional on an uninitialized value in one error path. clang-analyzer says: MokManager.c:1431:6: warning: Branch condition evaluates to a garbage value if (mok) ^~~ MokManager.c:1433:6: warning: Branch condition evaluates to a garbage value if (del_key) ^~~~~~~ And it's right; if we take the first error exit in the function, those never get initialized. This patch sets them to NULL to begin with. Signed-off-by: Peter Jones --- MokManager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MokManager.c b/MokManager.c index 16cf86fe..578c7249 100644 --- a/MokManager.c +++ b/MokManager.c @@ -1273,7 +1273,7 @@ static EFI_STATUS delete_keys(void *MokDel, UINTN MokDelSize, BOOLEAN MokX) UINT32 attributes; UINT8 *MokListData = NULL; UINTN MokListDataSize = 0; - MokListNode *mok, *del_key; + MokListNode *mok = NULL, *del_key = NULL; INTN mok_num, del_num; int i; -- cgit v1.2.3