diff options
author | relyea%netscape.com <devnull@localhost> | 2002-07-30 22:51:13 +0000 |
---|---|---|
committer | relyea%netscape.com <devnull@localhost> | 2002-07-30 22:51:13 +0000 |
commit | 9f99564e8b22e9178ae49ce160599bdbf1285d28 (patch) | |
tree | ec91144ecc3d3df8f2623f1a81b37d7f73522267 | |
parent | 19923aab19e8374d21ff608a09721ed1ade8fa99 (diff) | |
download | nss-hg-9f99564e8b22e9178ae49ce160599bdbf1285d28.tar.gz |
Fix pkcs12 memory leak.
-rw-r--r-- | security/nss/lib/pkcs7/p7decode.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/security/nss/lib/pkcs7/p7decode.c b/security/nss/lib/pkcs7/p7decode.c index a3a41bb79..74539c8c3 100644 --- a/security/nss/lib/pkcs7/p7decode.c +++ b/security/nss/lib/pkcs7/p7decode.c @@ -796,6 +796,7 @@ sec_pkcs7_decoder_finish_decrypt (SEC_PKCS7DecoderContext *p7dcx, * All done, destroy it. */ sec_PKCS7DestroyDecryptObject (worker->decryptobj); + worker->decryptobj = NULL; return SECSuccess; } @@ -1245,6 +1246,10 @@ SEC_PKCS7DecoderFinish(SEC_PKCS7DecoderContext *p7dcx) cinfo = NULL; } } + /* free any NSS data structures */ + if (p7dcx->worker.decryptobj) { + sec_PKCS7DestroyDecryptObject (p7dcx->worker.decryptobj); + } PORT_FreeArena (p7dcx->tmp_poolp, PR_FALSE); PORT_Free (p7dcx); return cinfo; @@ -1816,8 +1821,8 @@ sec_pkcs7_verify_signature(SEC_PKCS7ContentInfo *cinfo, rv = sec_PKCS7Decrypt (decryptobj, holder.data, &holder.len, buflen, sig->data, sig->len, PR_TRUE); + sec_PKCS7DestroyDecryptObject (decryptobj); if (rv != SECSuccess) { - sec_PKCS7DestroyDecryptObject (decryptobj); goto done; } |