From: Igor Kotrasinski Date: Wed, 18 Apr 2018 13:13:39 +0000 (+0200) Subject: Consistently check for null TAFactory X-Git-Tag: submit/tizen/20180828.110226~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F176805%2F3;p=platform%2Fcore%2Fsecurity%2Ftef-simulator.git Consistently check for null TAFactory Change-Id: Iffd615ba77c2291b553153273dce57198347e370 Signed-off-by: Igor Kotrasinski --- 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));