From c7000be86a82be286ec79155d78896fa7a7ff409 Mon Sep 17 00:00:00 2001 From: Adrian Dombeck Date: Tue, 17 Jan 2017 16:20:12 +0100 Subject: [PATCH] Fix check for NULL after malloc --- Pal/src/host/Linux-SGX/enclave_framework.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pal/src/host/Linux-SGX/enclave_framework.c b/Pal/src/host/Linux-SGX/enclave_framework.c index ff6ecb01..937b28eb 100644 --- a/Pal/src/host/Linux-SGX/enclave_framework.c +++ b/Pal/src/host/Linux-SGX/enclave_framework.c @@ -186,7 +186,7 @@ int load_trusted_file (PAL_HANDLE file, sgx_arch_mac_t ** stubptr, (tf->size % TRUSTED_STUB_SIZE ? 1 : 0); sgx_arch_mac_t * stubs = malloc(sizeof(sgx_arch_mac_t) * nstubs); - if (!tf) + if (!stubs) return -PAL_ERROR_NOMEM; sgx_arch_mac_t * s = stubs;