]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_smime/lib/cmsmessage.c
Security-57740.51.3.tar.gz
[apple/security.git] / OSX / libsecurity_smime / lib / cmsmessage.c
index 211f735568ebc7abedb60b46d0a2ca643e99a88e..387fb52c90644cea9a55e31f6a0c9d904018b6eb 100644 (file)
@@ -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);
     }
 }