From: Krzysztof Dynowski Date: Tue, 16 Jan 2018 11:30:17 +0000 (+0100) Subject: Initialize shared->buffer with NULL X-Git-Tag: submit/tizen/20180412.092951~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0728663605794c11644ea329c44dd136d0dc44c;p=platform%2Fcore%2Fsecurity%2Ftef-simulator.git Initialize shared->buffer with NULL Change-Id: Ia6bf28f88d9ec05cfdb941f82687f9d061312b1e --- diff --git a/TEECLib/src/teec_api.c b/TEECLib/src/teec_api.c index 085f57a..813f46d 100644 --- a/TEECLib/src/teec_api.c +++ b/TEECLib/src/teec_api.c @@ -864,6 +864,10 @@ TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, TEEC_ContextImp *context_imp; RegSharedMemData regmem; + if (sharedMem) { + sharedMem->buffer = NULL; + } + // Check if the Context is valid if (!context) { LOGE(TEEC_LIB, "context is NULL"); @@ -921,7 +925,6 @@ TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, return TEE_ERROR_OUT_OF_MEMORY; TEEC_SharedMemoryImp *sharedMem_imp = (TEEC_SharedMemoryImp *)sharedMem->imp; - sharedMem->buffer = NULL; sharedMem_imp->context = context; /* Allocate shared memory and get the Shared Memory key to be shared with