From: varinder.p Date: Fri, 25 Oct 2013 04:31:18 +0000 (+0900) Subject: Fixed memory leak in RsaConvertKey function. X-Git-Tag: submit/tizen/20131210.080830^2^2~19^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fframework%2Fnative%2Fappfw.git;a=commitdiff_plain;h=c797dfe085fe6419a911e065fc013cdf2e91e670 Fixed memory leak in RsaConvertKey function. Signed-off-by: varinder.p Change-Id: I2f46129780a5a7da81b63930e8f2c0d448049a05 --- diff --git a/src/security/FSecRsaKeyConverter.cpp b/src/security/FSecRsaKeyConverter.cpp index b8f9bff..84107e0 100644 --- a/src/security/FSecRsaKeyConverter.cpp +++ b/src/security/FSecRsaKeyConverter.cpp @@ -248,10 +248,9 @@ RsaKeyConverter::ConvertPublicKeyFormatN(RsaKeyFormat format, const IPublicKey& if (isPemFormat == true) { PublicKey nKey; - r = nKey.SetKey(*pOutBuffer); + r = nKey.SetKey(*pOutBuffer.get()); SysTryCatch(NID_SEC, !IsFailed(r), r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The specified input parameter is invalid."); - pOutBuffer.reset(ConvertDerToPemN(format, nKey)); - //pOutBuffer = std::unique_ptr< ByteBuffer >(ConvertDerToPemN(format, nKey)); + pOutBuffer = std::unique_ptr< ByteBuffer >(ConvertDerToPemN(format, nKey)); SysTryCatch(NID_SEC, pOutBuffer != null, r = GetLastResult(), GetLastResult(), "[%s] Failed to convert der to pem encoded byte buffer"); }