X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..07691282a056c4efea71e1e505527601e8cc166b:/OSX/libsecurity_smime/lib/cmsmessage.c diff --git a/OSX/libsecurity_smime/lib/cmsmessage.c b/OSX/libsecurity_smime/lib/cmsmessage.c index 816ce4af..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,9 @@ 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); + } } /*