X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/fa7225c82381bac4432a6edf16f53b5370238d85..07691282a056c4efea71e1e505527601e8cc166b:/OSX/libsecurity_smime/lib/cmsmessage.c diff --git a/OSX/libsecurity_smime/lib/cmsmessage.c b/OSX/libsecurity_smime/lib/cmsmessage.c index 75512389..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,9 +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? */ - cmsg->poolp = NULL; + if (cmsg->poolp_is_ours && cmsg->poolp) { + PORT_FreeArena (cmsg->poolp, PR_TRUE); } }