SoftSensor Manager - Fix potential issues detected by static analysis tool
authorjk13 <jihyeok13.kim@samsung.com>
Tue, 7 Apr 2015 06:54:58 +0000 (15:54 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 7 Apr 2015 10:14:42 +0000 (10:14 +0000)
Fix potential issues

Change-Id: Ifc22e31b7e3e0028914458ce71d94f5d4e9c991c
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/663
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/soft-sensor-manager/SSMCore/src/QueryProcessor/EvaluationEngine.cpp
service/soft-sensor-manager/SSMCore/src/SSMInterface/SSMResourceServer.cpp
service/soft-sensor-manager/SSMCore/src/SensorProcessor/ResourceFinder.cpp

index b2d1c6f..29603f2 100644 (file)
@@ -198,7 +198,6 @@ void CEvaluationEngine::terminateEngine()
         SSM_CLEANUP_ASSERT(executeSQL_NoReturn(sstream.str()));
         sstream.str("");
     }
-    m_mtxTriggerId.unlock();
 
     if (strlen(LOCATION_SSM_DB_DUMP) > 0)
     {
@@ -216,7 +215,9 @@ void CEvaluationEngine::terminateEngine()
     m_pSQLite3 = NULL;
 
     res = SSM_S_OK;
+
 CLEANUP:
+    m_mtxTriggerId.unlock();
     return;
 }
 
index e99f469..2fe7c17 100644 (file)
@@ -108,7 +108,8 @@ class CQueryEngineEvent: public IQueryEngineEvent
             g_vecQueryEventResults.push_back(queryEventResult);
 
             //TODO: need to modify for notifying proper clients
-            OCPlatform::notifyAllObservers(m_hSSMResource);
+            if (OCPlatform::notifyAllObservers(m_hSSMResource) != OC_STACK_OK)
+                return SSM_E_FAIL;
 
             return SSM_S_OK;
         }
index 9920eda..f782390 100644 (file)
@@ -236,6 +236,7 @@ void CResourceFinder::onExecute(IN void *pArg)
                 m_mapResourcePresenceHandles.erase(((OICResourceHandler *)pMessage[1])->m_SSMResource.ip);
             }
 
+            delete m_mapResourceHandler[((OICResourceHandler *)pMessage[1])->m_SSMResource.name];
             m_mapResourceHandler.erase(((OICResourceHandler *) pMessage[1])->m_SSMResource.name);
             break;
     }