Fix the jira issue: N_SE-33863
authorso.yu <so.yu@samsung.com>
Mon, 15 Apr 2013 12:43:40 +0000 (21:43 +0900)
committerso.yu <so.yu@samsung.com>
Mon, 15 Apr 2013 12:56:19 +0000 (21:56 +0900)
issue: Force close occur when install certificate.[Always]
solve: Fix the bug on error handling

Change-Id: Ib101c594b26fe8ad611c571315c5b9c70f91de54
Signed-off-by: so.yu <so.yu@samsung.com>
src/CertificateServiceStub.cpp

index 14c1723..e27ec4c 100644 (file)
@@ -466,7 +466,6 @@ result
 _CertServiceStub::UpdateCertStoreContext(int type)
 {
        result r = E_SUCCESS;
-       result* pRet = E_SUCCESS;
        void* pCertList = null;
 
        int index = GetIndexFromCertType(type);
@@ -474,7 +473,8 @@ _CertServiceStub::UpdateCertStoreContext(int type)
 
        if ((index >= 0) && (__refCount[index] > 0))
        {
-               *pRet = _CertServer::CloseCertificateStore(reinterpret_cast< CertificateStoreCtx >(__context[index]));
+               r = _CertServer::CloseCertificateStore(reinterpret_cast< CertificateStoreCtx >(__context[index]));
+               TryReturnResult(!IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
                pCertList = _CertServer::OpenCertificateStoreByType(static_cast< _CaCertType >(type), pCount);
                __context[index] = reinterpret_cast< int >(pCertList);
        }