From: Anju Date: Mon, 15 Jul 2013 11:25:18 +0000 (+0530) Subject: [SECURITY] Fixed valgrind tool issues X-Git-Tag: submit/tizen/20131210.080830^2^2~250^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd0e7a1e1c938096b5a9c9bffad248d2cd805c61;p=platform%2Fframework%2Fnative%2Fappfw.git [SECURITY] Fixed valgrind tool issues Change-Id: Iaadef926676173b19c0812cb473caffae7aa63b1 Signed-off-by: Anju --- diff --git a/src/security/pkcs/FSecPkcs_Pkcs08AttributeImpl.cpp b/src/security/pkcs/FSecPkcs_Pkcs08AttributeImpl.cpp index 5234ef7..e796141 100644 --- a/src/security/pkcs/FSecPkcs_Pkcs08AttributeImpl.cpp +++ b/src/security/pkcs/FSecPkcs_Pkcs08AttributeImpl.cpp @@ -50,6 +50,8 @@ _Pkcs08AttributeImpl::_Pkcs08AttributeImpl(void) _Pkcs08AttributeImpl::~_Pkcs08AttributeImpl(void) { + if (__attributeValues.GetCount() > 0) + __attributeValues.RemoveAll(); //do nothing } diff --git a/src/security/pkcs/FSecPkcs_Pkcs08EncryptedPrivateKeyInfoImpl.cpp b/src/security/pkcs/FSecPkcs_Pkcs08EncryptedPrivateKeyInfoImpl.cpp index 9a28344..c4c68fc 100644 --- a/src/security/pkcs/FSecPkcs_Pkcs08EncryptedPrivateKeyInfoImpl.cpp +++ b/src/security/pkcs/FSecPkcs_Pkcs08EncryptedPrivateKeyInfoImpl.cpp @@ -139,7 +139,10 @@ _Pkcs08EncryptedPrivateKeyInfoImpl::Construct(const AlgorithmIdentifier& algorit SysTryReturn(NID_SEC_CRYPTO, encryptedData.GetRemaining() > 0, r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The specified input parameter is invalid."); - r = __encryptionAlgorithm.Construct(algorithmId.GetAlgorithmObjectId(), algorithmId.GetParametersN()); + std::unique_ptr< IAlgorithmParameters > pParam(algorithmId.GetParametersN()); + SysTryReturn(NID_SEC_CRYPTO, pParam != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + r = __encryptionAlgorithm.Construct(algorithmId.GetAlgorithmObjectId(), pParam.get()); SysTryReturn(NID_SEC_CRYPTO, !IsFailed(r), r, r, "[%s] Failed to construct the algorithm identifier instance for encryption algorithm.", GetErrorMessage(r)); r = __encryptedData.Construct(encryptedData); diff --git a/src/security/pkcs/FSecPkcs_Pkcs08PrivateKeyInfoImpl.cpp b/src/security/pkcs/FSecPkcs_Pkcs08PrivateKeyInfoImpl.cpp index 8f2ae40..3fff4e1 100644 --- a/src/security/pkcs/FSecPkcs_Pkcs08PrivateKeyInfoImpl.cpp +++ b/src/security/pkcs/FSecPkcs_Pkcs08PrivateKeyInfoImpl.cpp @@ -54,6 +54,8 @@ _Pkcs08PrivateKeyInfoImpl::_Pkcs08PrivateKeyInfoImpl(void) //Default Destructor _Pkcs08PrivateKeyInfoImpl::~_Pkcs08PrivateKeyInfoImpl(void) { + if (__attributes.GetCount() > 0) + __attributes.RemoveAll(); //do nothing }