Update logic in CQueryEngine::executeContextQuery to free
clsContextQuery in case of error.
Change-Id: Ife66485b61a5f64ff5f190787482cdf6737850dd
Signed-off-by: Ankur Bansal <ankur.b1@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1519
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Minji Park <minjii.park@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
pConditionedQuery->addRef();
m_conditionedQueries[m_cqid] = pConditionedQuery;
m_contextQueries[m_cqid] = clsContextQuery;
+ clsContextQuery = NULL; //Mark it NULL, so that it's not freed in CLEANUP.
m_mtxQueries.unlock();
if (pConditionedQuery->hasAllConditionedModels() == true)
CLEANUP:
SAFE_RELEASE(pConditionedQuery);
SAFE_RELEASE(pConditionedQueryResult);
+ SAFE_DELETE(clsContextQuery);
return res;
}