X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/OSX/libsecurity_smime/lib/cmsmessage.c diff --git a/OSX/libsecurity_smime/lib/cmsmessage.c b/OSX/libsecurity_smime/lib/cmsmessage.c index 211f7355..387fb52c 100644 --- a/OSX/libsecurity_smime/lib/cmsmessage.c +++ b/OSX/libsecurity_smime/lib/cmsmessage.c @@ -58,7 +58,7 @@ SecCmsMessageCreate(SecArenaPoolRef pool) { PLArenaPool *poolp = (PLArenaPool *)pool; void *mark = NULL; - SecCmsMessageRef cmsg; + SecCmsMessageRef cmsg = NULL; Boolean poolp_is_ours = PR_FALSE; if (poolp == NULL) { @@ -135,8 +135,8 @@ SecCmsMessageDestroy(SecCmsMessageRef cmsg) SecCmsContentInfoDestroy(&(cmsg->contentInfo)); /* if poolp is not NULL, cmsg is the owner of its arena */ - if (cmsg->poolp_is_ours) { - PORT_FreeArena (cmsg->poolp, PR_FALSE); /* XXX clear it? */ + if (cmsg->poolp_is_ours && cmsg->poolp) { + PORT_FreeArena (cmsg->poolp, PR_TRUE); } }