From 254eb9ad8c24aed2cb4bc931de18015002ceb60d Mon Sep 17 00:00:00 2001 From: Igor Kotrasinski Date: Wed, 18 Apr 2018 15:13:39 +0200 Subject: [PATCH] Consistently check for null TAFactory Change-Id: Iffd615ba77c2291b553153273dce57198347e370 Signed-off-by: Igor Kotrasinski --- simulatordaemon/src/Session.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/simulatordaemon/src/Session.cpp b/simulatordaemon/src/Session.cpp index 3530af1..19faa6a 100644 --- a/simulatordaemon/src/Session.cpp +++ b/simulatordaemon/src/Session.cpp @@ -96,6 +96,10 @@ TEEC_Result Session::createSession(OpenSessionData data) { // Get TA factory instance TAFactory *TAFact = TAFactory::getInstance(); + if (NULL == TAFact) { + LOGE(SIM_DAEMON, "TA Factory instance creation failed. Check logs for further info"); + return TEEC_ERROR_OUT_OF_MEMORY; + } // Update member variable mSessionID with the assigned session ID mSessionID = data.sessionID; @@ -290,6 +294,10 @@ TEEC_Result Session::finalize(uint32_t contextID) { // Get TA Factory insatnce TAFactory *TAFact = TAFactory::getInstance(); + if (NULL == TAFact) { + LOGE(SIM_DAEMON, "TA Factory instance creation failed. Check logs for further info"); + return TEEC_ERROR_OUT_OF_MEMORY; + } // Generate CloseTASessionData to be sent to TA CloseTASessionData cdata; memset(&cdata, 0, sizeof(CloseTASessionData)); -- 2.34.1