X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/e3d460c9de4426da6c630c3ae3f46173a99f82d8..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/OSX/libsecurity_cms/lib/CMSDecoder.cpp diff --git a/OSX/libsecurity_cms/lib/CMSDecoder.cpp b/OSX/libsecurity_cms/lib/CMSDecoder.cpp index a8d81d09..dcb79035 100644 --- a/OSX/libsecurity_cms/lib/CMSDecoder.cpp +++ b/OSX/libsecurity_cms/lib/CMSDecoder.cpp @@ -127,19 +127,20 @@ static void cmsDecoderFinalize( if(cmsDecoder->decoder != NULL) { /* * Normally this gets freed in SecCmsDecoderFinish - this is - * an error case. - * FIXME: SecCmsDecoderDestroy() appears to destroy the - * cmsMsg too! Plus there's a comment there re: a leak... + * an error case. Unlike Finish, this calls SecCmsMessageDestroy. */ SecCmsDecoderDestroy(cmsDecoder->decoder); + cmsDecoder->cmsMsg = NULL; } CFRELEASE(cmsDecoder->detachedContent); CFRELEASE(cmsDecoder->keychainOrArray); if(cmsDecoder->cmsMsg != NULL) { SecCmsMessageDestroy(cmsDecoder->cmsMsg); + cmsDecoder->cmsMsg = NULL; } if(cmsDecoder->arena != NULL) { SecArenaPoolFree(cmsDecoder->arena, false); + cmsDecoder->arena = NULL; } }